Changeset bad4a05 in mainline for uspace/drv


Ignore:
Timestamp:
2018-01-11T04:12:06Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0892663a
Parents:
a6c4597
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-11 01:31:42)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-11 04:12:06)
Message:

usbhost: made device_remove and endpoint_unregister noexcept

Location:
uspace/drv/bus/usb
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/ehci_bus.c

    ra6c4597 rbad4a05  
    113113}
    114114
    115 static int ehci_unregister_ep(endpoint_t *ep)
     115static void ehci_unregister_ep(endpoint_t *ep)
    116116{
    117117        bus_t *bus_base = endpoint_get_bus(ep);
     
    120120        assert(ep);
    121121
    122         const int err = usb2_bus_ops.endpoint_unregister(ep);
    123         if (err)
    124                 return err;
    125 
     122        usb2_bus_ops.endpoint_unregister(ep);
    126123        hc_dequeue_endpoint(bus->hc, ep);
    127         return EOK;
    128124}
    129125
  • uspace/drv/bus/usb/ohci/ohci_bus.c

    ra6c4597 rbad4a05  
    118118}
    119119
    120 static int ohci_unregister_ep(endpoint_t *ep)
     120static void ohci_unregister_ep(endpoint_t *ep)
    121121{
    122122        ohci_bus_t *bus = (ohci_bus_t *) endpoint_get_bus(ep);
    123123        assert(ep);
    124124
    125         const int err = usb2_bus_ops.endpoint_unregister(ep);
    126         if (err)
    127                 return err;
    128 
     125        usb2_bus_ops.endpoint_unregister(ep);
    129126        hc_dequeue_endpoint(bus->hc, ep);
    130         return EOK;
    131127}
    132128
  • uspace/drv/bus/usb/xhci/bus.c

    ra6c4597 rbad4a05  
    193193}
    194194
    195 static int endpoint_unregister(endpoint_t *);
    196 
    197195/**
    198196 * Remove device from XHCI bus. Transition it to the offline state, abort all
     
    205203 * @return Error code.
    206204 */
    207 static int device_remove(device_t *dev)
     205static void device_remove(device_t *dev)
    208206{
    209207        int err;
     
    249247                        continue;
    250248
    251                 if ((err = endpoint_unregister(dev->endpoints[i]))) {
    252                         usb_log_warning("Failed to unregister endpoint " XHCI_EP_FMT ": %s",
    253                             XHCI_EP_ARGS(*xhci_device_get_endpoint(xhci_dev, i)), str_error(err));
    254                 }
     249                bus_endpoint_remove(dev->endpoints[i]);
    255250        }
    256251
     
    258253        /* XXX: Not a good idea, this method should not destroy devices. */
    259254        hcd_ddf_fun_destroy(dev);
    260 
    261         return EOK;
    262255}
    263256
     
    415408 * Bus callback.
    416409 */
    417 static int endpoint_unregister(endpoint_t *ep_base)
     410static void endpoint_unregister(endpoint_t *ep_base)
    418411{
    419412        int err;
     
    433426                    " the slot has already been disabled.", XHCI_EP_ARGS(*ep));
    434427        }
    435 
    436         return EOK;
    437428}
    438429
  • uspace/drv/bus/usb/xhci/rh.c

    ra6c4597 rbad4a05  
    188188{
    189189        assert(rh);
    190         int err;
    191190
    192191        /* Find XHCI device by the port. */
     
    207206
    208207        /* Remove device from XHCI bus. */
    209         if ((err = bus_device_remove(&dev->base))) {
    210                 usb_log_warning("Failed to remove device " XHCI_DEV_FMT " from XHCI bus: %s",
    211                     XHCI_DEV_ARGS(*dev), str_error(err));
    212         }
     208        bus_device_remove(&dev->base);
    213209
    214210        return EOK;
Note: See TracChangeset for help on using the changeset viewer.