Changes in uspace/lib/usbdev/src/pipes.c [56bdd9a4:7fc260ff] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipes.c
r56bdd9a4 r7fc260ff 54 54 static usb_address_t get_my_address(async_sess_t *sess, const ddf_dev_t *dev) 55 55 { 56 assert(sess);57 56 async_exch_t *exch = async_exchange_begin(sess); 58 if (!exch) 59 return ENOMEM; 60 61 usb_address_t address; 62 const int ret = usb_get_my_address(exch, &address); 63 57 58 sysarg_t address; 59 int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 60 IPC_M_USB_GET_MY_ADDRESS, &address); 61 64 62 async_exchange_end(exch); 65 66 return (ret == EOK) ? address : ret; 63 64 if (rc != EOK) 65 return rc; 66 67 return (usb_address_t) address; 67 68 } 68 69 … … 70 71 * 71 72 * @param device Device in question. 72 * @return Error code (ENOTSUPmeans any).73 * @return Interface number (negative code means any). 73 74 */ 74 75 int usb_device_get_assigned_interface(const ddf_dev_t *device) … … 79 80 IPC_FLAG_BLOCKING); 80 81 if (!parent_sess) 81 return ENOMEM;82 82 return -1; 83 83 84 async_exch_t *exch = async_exchange_begin(parent_sess); 84 if (!exch) { 85 async_hangup(parent_sess); 86 return ENOMEM; 87 } 88 89 int iface_no; 90 const int ret = usb_get_my_interface(exch, &iface_no); 91 92 return ret == EOK ? iface_no : ret; 85 86 sysarg_t iface_no; 87 int rc = async_req_2_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 88 IPC_M_USB_GET_INTERFACE, device->handle, &iface_no); 89 90 async_exchange_end(exch); 91 async_hangup(parent_sess); 92 93 if (rc != EOK) 94 return -1; 95 96 return (int) iface_no; 93 97 } 94 98
Note:
See TracChangeset
for help on using the changeset viewer.