Changeset 561f41b in mainline for uspace/drv/ohci/main.c
- Timestamp:
- 2011-05-07T16:00:10Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 60b3bea
- Parents:
- b23e9cc (diff), 3ae5ca8 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/main.c
rb23e9cc r561f41b 43 43 #define NAME "ohci" 44 44 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 */ 50 static 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 } 46 65 /*----------------------------------------------------------------------------*/ 47 66 static driver_ops_t ohci_driver_ops = { … … 53 72 .driver_ops = &ohci_driver_ops 54 73 }; 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 hc_register_hub(&ohci->hc, ohci->rh_fun);79 80 usb_log_info("Controlling new OHCI device `%s'.\n", device->name);81 82 return EOK;83 }84 74 /*----------------------------------------------------------------------------*/ 85 75 /** Initializes global driver structures (NONE).
Note:
See TracChangeset
for help on using the changeset viewer.