Changeset 5153b58 in mainline
- Timestamp:
- 2011-11-05T17:55:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9f583151
- Parents:
- 207acc4e
- Location:
- uspace/drv/bus/usb/usbmid
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmid/main.c
r207acc4e r5153b58 68 68 /** Callback when a MID device is about to be removed from the host. 69 69 * 70 * @param gen_dev Generic DDFdevice representing the removed device.70 * @param dev USB device representing the removed device. 71 71 * @return Error code. 72 72 */ … … 74 74 { 75 75 assert(dev); 76 usb_mid_t *usb_mid = dev->driver_data; 77 assert(usb_mid); 76 78 77 79 /* Remove ctl function */ 78 usb_mid_t *usb_mid = dev->driver_data;79 80 int ret = ddf_fun_unbind(usb_mid->ctl_fun); 80 81 if (ret != EOK) { … … 109 110 pret = usbmid_interface_destroy(iface); 110 111 if (pret != EOK) { 111 usb_log_error("Failed to removechild for interface "112 usb_log_error("Failed to destroy child for interface " 112 113 "%d (%s): %s\n", iface->interface_no, 113 114 usb_str_class(iface->interface->interface_class), … … 121 122 /** Callback when a MID device was removed from the host. 122 123 * 123 * @param gen_dev Generic DDFdevice representing the removed device.124 * @param dev USB device representing the removed device. 124 125 * @return Error code. 125 126 */ … … 127 128 { 128 129 assert(dev); 130 usb_mid_t *usb_mid = dev->driver_data; 131 assert(usb_mid); 132 129 133 usb_log_info("USB MID gone: `%s'.\n", dev->ddf_dev->name); 130 134 131 135 /* Remove ctl function */ 132 usb_mid_t *usb_mid = dev->driver_data;133 136 int ret = ddf_fun_unbind(usb_mid->ctl_fun); 134 137 if (ret != EOK) { -
uspace/drv/bus/usb/usbmid/usbmid.c
r207acc4e r5153b58 124 124 } 125 125 126 iface->fun = child;127 128 child->driver_data = iface;129 child->ops = &child_device_ops;130 131 126 rc = usb_device_create_match_ids_from_interface(device_descriptor, 132 127 interface_descriptor, &child->match_ids); … … 143 138 } 144 139 140 iface->fun = child; 141 child->driver_data = iface; 142 child->ops = &child_device_ops; 143 145 144 return EOK; 146 145 }
Note:
See TracChangeset
for help on using the changeset viewer.