Changeset 34289ea in mainline
- Timestamp:
- 2012-12-30T19:04:34Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 68e1023
- Parents:
- db8b7ca
- Location:
- uspace/drv/bus/usb/usbmid
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/drv/bus/usb/usbmid/explore.c ¶
rdb8b7ca r34289ea 57 57 { 58 58 list_foreach(*list, l) { 59 usbmid_interface_t *iface = usbmid_interface_from_link(l);59 const usbmid_interface_t *iface = usbmid_interface_from_link(l); 60 60 if (iface->interface_no == interface_no) { 61 61 return true; … … 130 130 * @return Whether to accept this device from devman. 131 131 */ 132 boolusbmid_explore_device(usb_device_t *dev)132 int usbmid_explore_device(usb_device_t *dev) 133 133 { 134 int rc; 135 136 unsigned dev_class = dev->descriptors.device.device_class; 134 const unsigned dev_class = dev->descriptors.device.device_class; 137 135 if (dev_class != USB_CLASS_USE_INTERFACE) { 138 136 usb_log_warning( … … 140 138 dev_class, usb_str_class(dev_class), 141 139 USB_CLASS_USE_INTERFACE); 142 usb_log_error("Not multiinterface device, refusing.\n");143 return false;140 usb_log_error("Not a multi-interface device, refusing.\n"); 141 return ENOTSUP; 144 142 } 145 143 … … 151 149 152 150 /* Select the first configuration */ 153 rc = usb_request_set_configuration(&dev->ctrl_pipe,151 int rc = usb_request_set_configuration(&dev->ctrl_pipe, 154 152 config_descriptor->configuration_number); 155 153 if (rc != EOK) { 156 154 usb_log_error("Failed to set device configuration: %s.\n", 157 155 str_error(rc)); 158 return false; 159 } 156 return rc; 157 } 158 159 160 160 161 161 /* Create driver soft-state. */ … … 163 163 if (!usb_mid) { 164 164 usb_log_error("Failed to create USB MID structure.\n"); 165 return false;165 return ENOMEM; 166 166 } 167 167 … … 170 170 if (usb_mid->ctl_fun == NULL) { 171 171 usb_log_error("Failed to create control function.\n"); 172 return false;172 return ENOMEM; 173 173 } 174 174 ddf_fun_set_ops(usb_mid->ctl_fun, &mid_device_ops); … … 180 180 str_error(rc)); 181 181 ddf_fun_destroy(usb_mid->ctl_fun); 182 return false;182 return rc; 183 183 } 184 184 … … 205 205 } 206 206 207 return true;207 return EOK; 208 208 } 209 209 -
TabularUnified uspace/drv/bus/usb/usbmid/main.c ¶
rdb8b7ca r34289ea 53 53 usb_log_info("Taking care of new MID `%s'.\n", ddf_dev_get_name(dev->ddf_dev)); 54 54 55 const bool accept = usbmid_explore_device(dev); 56 57 if (!accept) { 58 return ENOTSUP; 59 } 60 61 return EOK; 55 return usbmid_explore_device(dev); 62 56 } 63 57 -
TabularUnified uspace/drv/bus/usb/usbmid/usbmid.h ¶
rdb8b7ca r34289ea 64 64 } usb_mid_t; 65 65 66 boolusbmid_explore_device(usb_device_t *);66 int usbmid_explore_device(usb_device_t *); 67 67 int usbmid_spawn_interface_child(usb_device_t *, usbmid_interface_t *, 68 68 const usb_standard_device_descriptor_t *,
Note:
See TracChangeset
for help on using the changeset viewer.