Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hc.c

    r27ed734c r02fc5c4  
    153153        if (!usb_hc_connection_is_opened(connection))
    154154                return ENOENT;
    155        
     155
    156156        async_exch_t *exch = async_exchange_begin(connection->hc_sess);
    157        
    158         sysarg_t tmp;
    159         int rc = async_req_2_1(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    160             IPC_M_USBHC_GET_HANDLE_BY_ADDRESS,
    161             address, &tmp);
    162        
     157        if (!exch)
     158                return ENOMEM;
     159        const int ret = usbhc_get_handle(exch, address, handle);
    163160        async_exchange_end(exch);
    164        
    165         if ((rc == EOK) && (handle != NULL))
    166                 *handle = tmp;
    167        
    168         return rc;
     161        return ret;
    169162}
    170163
     
    181174        if (!parent_sess)
    182175                return ENOMEM;
    183        
     176
    184177        async_exch_t *exch = async_exchange_begin(parent_sess);
    185        
    186         sysarg_t address;
    187         int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
    188             IPC_M_USB_GET_MY_ADDRESS, &address);
    189        
     178        if (!exch) {
     179                async_hangup(parent_sess);
     180                return ENOMEM;
     181        }
     182        usb_address_t address;
     183        const int ret = usb_get_my_address(exch, &address);
     184
    190185        async_exchange_end(exch);
    191186        async_hangup(parent_sess);
    192        
    193         if (rc != EOK)
    194                 return rc;
    195        
    196         return (usb_address_t) address;
     187
     188        if (ret != EOK)
     189                return ret;
     190
     191        return address;
    197192}
    198193
     
    231226        if (!parent_sess)
    232227                return ENOMEM;
    233        
     228
    234229        async_exch_t *exch = async_exchange_begin(parent_sess);
    235        
    236         devman_handle_t h;
    237         int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
    238             IPC_M_USB_GET_HOST_CONTROLLER_HANDLE, &h);
    239        
     230        if (!exch) {
     231                async_hangup(parent_sess);
     232                return ENOMEM;
     233        }
     234        const int ret = usb_get_hc_handle(exch, hc_handle);
     235
    240236        async_exchange_end(exch);
    241237        async_hangup(parent_sess);
    242        
    243         if (rc != EOK)
    244                 return rc;
    245        
    246         if (hc_handle != NULL)
    247                 *hc_handle = h;
    248        
    249         return EOK;
     238
     239        return ret;
    250240}
    251241
Note: See TracChangeset for help on using the changeset viewer.