Changes in uspace/lib/usbdev/src/driver.c [c01987c:a1732929] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/driver.c
rc01987c ra1732929 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. \n",64 usb_log_error("USB device `%s' init failed (%s): %s.", 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 == NULL)87 if (driver->ops->device_remove == NULL) 88 88 return ENOTSUP; 89 89 90 /* Just tell the driver to stop whatever it is doing */ 90 91 usb_device_t *usb_dev = ddf_dev_data_get(gen_dev); 91 const int ret = driver->ops->device_rem(usb_dev);92 int ret = driver->ops->device_remove(usb_dev); 92 93 if (ret != EOK) 93 94 return ret; 95 94 96 usb_device_destroy_ddf(gen_dev); 95 97 return EOK; … … 117 119 } 118 120 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 119 153 static driver_ops_t generic_driver_ops = { 120 154 .dev_add = generic_device_add, 121 155 .dev_remove = generic_device_remove, 122 156 .dev_gone = generic_device_gone, 157 .fun_online = generic_function_online, 158 .fun_offline = generic_function_offline, 123 159 }; 124 160 static driver_t generic_driver = {
Note:
See TracChangeset
for help on using the changeset viewer.