Changeset 20a3465 in mainline for uspace/drv/bus/usb/usbflbk/main.c
- Timestamp:
- 2011-10-30T19:50:54Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3ce78580, 48902fa
- Parents:
- 4c3ad56 (diff), 45bf63c (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/bus/usb/usbflbk/main.c
r4c3ad56 r20a3465 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 about to be removed. 77 * 78 * @param dev Representation of a generic DDF device. 79 * @return Error code. 80 */ 81 static int usbfallback_device_remove(usb_device_t *dev) 82 { 83 return EOK; 84 } 85 86 /** Callback when new device is removed and recognized as gone by DDF. 87 * 88 * @param dev Representation of a generic DDF device. 89 * @return Error code. 90 */ 91 static int usbfallback_device_gone(usb_device_t *dev) 92 { 93 assert(dev); 94 ddf_fun_t *ctl_fun = dev->driver_data; 95 const int ret = ddf_fun_unbind(ctl_fun); 96 if (ret != EOK) { 97 usb_log_error("Failed to unbind %s.\n", ctl_fun->name); 98 return ret; 99 } 100 ddf_fun_destroy(ctl_fun); 101 dev->driver_data = NULL; 102 103 return EOK; 104 } 105 74 106 /** USB fallback driver ops. */ 75 static usb_driver_ops_t usbfallback_driver_ops = {107 static const usb_driver_ops_t usbfallback_driver_ops = { 76 108 .device_add = usbfallback_device_add, 109 .device_rem = usbfallback_device_remove, 110 .device_gone = usbfallback_device_gone, 77 111 }; 78 112 79 113 /** USB fallback driver. */ 80 static usb_driver_t usbfallback_driver = {114 static const usb_driver_t usbfallback_driver = { 81 115 .name = NAME, 82 116 .ops = &usbfallback_driver_ops,
Note:
See TracChangeset
for help on using the changeset viewer.