Changeset 00aece0 in mainline for uspace/drv/bus/usb/usbflbk/main.c
- Timestamp:
- 2012-02-18T16:47:38Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4449c6c
- Parents:
- bd5f3b7 (diff), f943dd3 (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
-
TabularUnified uspace/drv/bus/usb/usbflbk/main.c ¶
rbd5f3b7 r00aece0 46 46 * @return Error code. 47 47 */ 48 static int usbfallback_ add_device(usb_device_t *dev)48 static int usbfallback_device_add(usb_device_t *dev) 49 49 { 50 50 int rc; … … 64 64 } 65 65 66 dev->driver_data = ctl_fun; 67 66 68 usb_log_info("Pretending to control %s `%s'" \ 67 69 " (node `%s', handle %" PRIun ").\n", … … 72 74 } 73 75 76 /** Callback when new device is removed and recognized as gone by DDF. 77 * 78 * @param dev Representation of a generic DDF device. 79 * @return Error code. 80 */ 81 static int usbfallback_device_gone(usb_device_t *dev) 82 { 83 assert(dev); 84 ddf_fun_t *ctl_fun = dev->driver_data; 85 const int ret = ddf_fun_unbind(ctl_fun); 86 if (ret != EOK) { 87 usb_log_error("Failed to unbind %s.\n", ctl_fun->name); 88 return ret; 89 } 90 ddf_fun_destroy(ctl_fun); 91 dev->driver_data = NULL; 92 93 return EOK; 94 } 95 74 96 /** USB fallback driver ops. */ 75 static usb_driver_ops_t usbfallback_driver_ops = { 76 .add_device = usbfallback_add_device, 97 static const usb_driver_ops_t usbfallback_driver_ops = { 98 .device_add = usbfallback_device_add, 99 .device_rem = usbfallback_device_gone, 100 .device_gone = usbfallback_device_gone, 77 101 }; 78 102 79 103 /** USB fallback driver. */ 80 static usb_driver_t usbfallback_driver = {104 static const usb_driver_t usbfallback_driver = { 81 105 .name = NAME, 82 106 .ops = &usbfallback_driver_ops,
Note:
See TracChangeset
for help on using the changeset viewer.