Changes in uspace/lib/usbdev/src/driver.c [a1732929:c01987c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/driver.c
ra1732929 rc01987c 62 62 int rc = usb_device_create_ddf(gen_dev, driver->endpoints, &err_msg); 63 63 if (rc != EOK) { 64 usb_log_error("USB device `%s' init failed (%s): %s. ",64 usb_log_error("USB device `%s' init failed (%s): %s.\n", 65 65 ddf_dev_get_name(gen_dev), err_msg, str_error(rc)); 66 66 return rc; … … 85 85 assert(driver); 86 86 assert(driver->ops); 87 if (driver->ops->device_rem ove== NULL)87 if (driver->ops->device_rem == NULL) 88 88 return ENOTSUP; 89 90 89 /* Just tell the driver to stop whatever it is doing */ 91 90 usb_device_t *usb_dev = ddf_dev_data_get(gen_dev); 92 int ret = driver->ops->device_remove(usb_dev);91 const int ret = driver->ops->device_rem(usb_dev); 93 92 if (ret != EOK) 94 93 return ret; 95 96 94 usb_device_destroy_ddf(gen_dev); 97 95 return EOK; … … 119 117 } 120 118 121 /** Callback when the driver is asked to online a specific function.122 *123 * This callback is a wrapper for USB specific version of @c fun_online.124 *125 * @param gen_dev Device function structure as prepared by DDF.126 * @return Error code.127 */128 static int generic_function_online(ddf_fun_t *fun)129 {130 assert(driver);131 assert(driver->ops);132 if (driver->ops->function_online == NULL)133 return ENOTSUP;134 return driver->ops->function_online(fun);135 }136 137 /** Callback when the driver is asked to offline a specific function.138 *139 * This callback is a wrapper for USB specific version of @c fun_offline.140 *141 * @param gen_dev Device function structure as prepared by DDF.142 * @return Error code.143 */144 static int generic_function_offline(ddf_fun_t *fun)145 {146 assert(driver);147 assert(driver->ops);148 if (driver->ops->function_offline == NULL)149 return ENOTSUP;150 return driver->ops->function_offline(fun);151 }152 153 119 static driver_ops_t generic_driver_ops = { 154 120 .dev_add = generic_device_add, 155 121 .dev_remove = generic_device_remove, 156 122 .dev_gone = generic_device_gone, 157 .fun_online = generic_function_online,158 .fun_offline = generic_function_offline,159 123 }; 160 124 static driver_t generic_driver = {
Note:
See TracChangeset
for help on using the changeset viewer.