Changeset 8be7819 in mainline for uspace/drv/bus/usb/usbmid/main.c
- Timestamp:
- 2011-10-30T19:59:15Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cae002c
- Parents:
- e462909
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmid/main.c
re462909 r8be7819 74 74 { 75 75 assert(dev); 76 int ret = ENOTSUP; 76 77 /* Remove ctl function */ 77 78 usb_mid_t *usb_mid = dev->driver_data; 78 assert(usb_mid); 79 int ret = ddf_fun_unbind(usb_mid->ctl_fun); 80 if (ret != EOK) { 81 usb_log_error("Failed to unbind USB MID ctl function: %s.\n", 82 str_error(ret)); 83 return ret; 84 } 85 ddf_fun_destroy(usb_mid->ctl_fun); 79 86 80 /* Signal all interface functions */ 81 list_foreach(usb_mid->interface_list, item) { 87 /* Remove all children */ 88 while (!list_empty(&usb_mid->interface_list)) { 89 link_t *item = list_first(&usb_mid->interface_list); 90 list_remove(item); 91 82 92 usbmid_interface_t *iface = usbmid_interface_from_link(item); 83 93 84 usb_log_info(" Signaling remove to child for interface "85 "%d (%s).\n",iface->interface_no,94 usb_log_info("Removing child for interface %d (%s).\n", 95 iface->interface_no, 86 96 usb_str_class(iface->interface->interface_class)); 87 // TODO cascade the call. 97 98 /* Tell the child to go off-line. */ 99 int pret = ddf_fun_offline(iface->fun); 100 if (pret != EOK) { 101 usb_log_warning("Failed to turn off child for interface" 102 " %d (%s): %s\n", iface->interface_no, 103 usb_str_class(iface->interface->interface_class), 104 str_error(pret)); 105 ret = pret; 106 } 107 108 /* Now remove the child. */ 109 pret = usbmid_interface_destroy(iface); 110 if (pret != EOK) { 111 usb_log_error("Failed to remove child for interface " 112 "%d (%s): %s\n", iface->interface_no, 113 usb_str_class(iface->interface->interface_class), 114 str_error(pret)); 115 ret = pret; 116 } 88 117 } 89 118 return ret; … … 117 146 usbmid_interface_t *iface = usbmid_interface_from_link(item); 118 147 119 usb_log_info(" Removing child for interface %d (%s).\n",148 usb_log_info("Child for interface %d (%s) gone.\n", 120 149 iface->interface_no, 121 150 usb_str_class(iface->interface->interface_class));
Note:
See TracChangeset
for help on using the changeset viewer.