Changeset a799708 in mainline for uspace/drv/bus/usb/uhci/main.c


Ignore:
Timestamp:
2015-07-04T01:49:47Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d51ba359
Parents:
8d7552c
Message:

ehci,ohci,uhci: Switch to generic hc drv initialization function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/main.c

    r8d7552c ra799708  
    106106        return rc;
    107107}
     108static const ddf_hc_driver_t uhci_hc_driver = {
     109        .claim = disable_legacy,
     110        .hc_speed = USB_SPEED_FULL,
     111        .irq_code_gen = uhci_hc_gen_irq_code,
     112        .init = uhci_driver_init,
     113        .fini = uhci_driver_fini,
     114        .name = "UHCI"
     115};
     116
    108117
    109118/** Initialize a new ddf driver instance for uhci hc and hub.
     
    116125        usb_log_debug2("uhci_dev_add() called\n");
    117126        assert(device);
    118 
    119         int ret = disable_legacy(device);
    120         if (ret != EOK) {
    121                 usb_log_error("Failed to disable legacy USB: %s.\n",
    122                     str_error(ret));
    123                 return ret;
    124         }
    125 
    126 
    127         ret = ddf_hcd_device_setup_all(device, USB_SPEED_FULL,
    128             BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11,
    129             ddf_hcd_gen_irq_handler, uhci_hc_gen_irq_code,
    130             uhci_driver_init, uhci_driver_fini);
    131         if (ret != EOK) {
    132                 usb_log_error("Failed to initialize UHCI driver: %s.\n",
    133                     str_error(ret));
    134         } else {
    135                 usb_log_info("Controlling new UHCI device '%s'.\n",
    136                     ddf_dev_get_name(device));
    137         }
    138 
    139         return ret;
     127        return hcd_ddf_add_hc(device, &uhci_hc_driver);
    140128}
    141129
Note: See TracChangeset for help on using the changeset viewer.