Changeset 9e195e2c in mainline for uspace/drv/ohci/main.c


Ignore:
Timestamp:
2011-05-12T09:03:00Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d59d0bb
Parents:
456aea3 (diff), c372e03 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from development

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/main.c

    r456aea3 r9e195e2c  
    4343#define NAME "ohci"
    4444
    45 static int ohci_add_device(ddf_dev_t *device);
     45/** Initializes a new ddf driver instance of OHCI hcd.
     46 *
     47 * @param[in] device DDF instance of the device to initialize.
     48 * @return Error code.
     49 */
     50static int ohci_add_device(ddf_dev_t *device)
     51{
     52        usb_log_debug("ohci_add_device() called\n");
     53        assert(device);
     54
     55        int ret = device_setup_ohci(device);
     56        if (ret != EOK) {
     57                usb_log_error("Failed to initialize OHCI driver: %s.\n",
     58                    str_error(ret));
     59                return ret;
     60        }
     61        usb_log_info("Controlling new OHCI device '%s'.\n", device->name);
     62
     63        return EOK;
     64}
    4665/*----------------------------------------------------------------------------*/
    4766static driver_ops_t ohci_driver_ops = {
     
    5372        .driver_ops = &ohci_driver_ops
    5473};
    55 /*----------------------------------------------------------------------------*/
    56 /** Initializes a new ddf driver instance of OHCI hcd.
    57  *
    58  * @param[in] device DDF instance of the device to initialize.
    59  * @return Error code.
    60  */
    61 int ohci_add_device(ddf_dev_t *device)
    62 {
    63         usb_log_debug("ohci_add_device() called\n");
    64         assert(device);
    65         ohci_t *ohci = malloc(sizeof(ohci_t));
    66         if (ohci == NULL) {
    67                 usb_log_error("Failed to allocate OHCI driver.\n");
    68                 return ENOMEM;
    69         }
    70 
    71         int ret = ohci_init(ohci, device);
    72         if (ret != EOK) {
    73                 usb_log_error("Failed to initialize OHCI driver: %s.\n",
    74                     str_error(ret));
    75                 return ret;
    76         }
    77         device->driver_data = ohci;
    78 
    79         usb_log_info("Controlling new OHCI device `%s'.\n", device->name);
    80 
    81         return EOK;
    82 }
    8374/*----------------------------------------------------------------------------*/
    8475/** Initializes global driver structures (NONE).
     
    9384{
    9485        usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME);
    95         sleep(5);
    9686        return ddf_driver_main(&ohci_driver);
    9787}
Note: See TracChangeset for help on using the changeset viewer.