Changeset 54cbda2 in mainline
- Timestamp:
- 2011-12-14T22:26:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4291215
- Parents:
- 8e3742f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devdrv.c
r8e3742f9 r54cbda2 102 102 assert(driver->ops->device_add); 103 103 104 /* Get place for driver data. */ 104 105 usb_device_t *dev = ddf_dev_data_alloc(gen_dev, sizeof(usb_device_t)); 105 106 if (dev == NULL) { … … 108 109 return ENOMEM; 109 110 } 111 112 /* Initialize generic USB driver data. */ 110 113 const char *err_msg = NULL; 111 114 int rc = usb_device_init(dev, gen_dev, driver->endpoints, &err_msg); … … 116 119 } 117 120 121 /* Start USB driver specific initialization. */ 118 122 rc = driver->ops->device_add(dev); 119 123 if (rc != EOK) … … 135 139 if (driver->ops->device_rem == NULL) 136 140 return ENOTSUP; 137 /* Just tell the driver to stop whatever it is doing, keep structures */ 138 const int ret = driver->ops->device_rem(gen_dev->driver_data); 141 /* Just tell the driver to stop whatever it is doing */ 142 usb_device_t *usb_dev = gen_dev->driver_data; 143 const int ret = driver->ops->device_rem(usb_dev); 139 144 if (ret != EOK) 140 145 return ret; 141 return ENOTSUP; 146 usb_device_deinit(usb_dev); 147 return EOK; 142 148 } 143 149 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.