Changeset 56fd7cf in mainline for uspace/drv/bus/usb/usbmid
- Timestamp:
- 2012-08-17T11:37:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1d5a540
- Parents:
- be2a38ad
- Location:
- uspace/drv/bus/usb/usbmid
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmid/explore.c
rbe2a38ad r56fd7cf 172 172 return false; 173 173 } 174 usb_mid->ctl_fun->ops = &mid_device_ops;174 ddf_fun_set_ops(usb_mid->ctl_fun, &mid_device_ops); 175 175 176 176 /* Bind control function. */ -
uspace/drv/bus/usb/usbmid/main.c
rbe2a38ad r56fd7cf 51 51 static int usbmid_device_add(usb_device_t *dev) 52 52 { 53 usb_log_info("Taking care of new MID `%s'.\n", d ev->ddf_dev->name);53 usb_log_info("Taking care of new MID `%s'.\n", ddf_dev_get_name(dev->ddf_dev)); 54 54 55 55 const bool accept = usbmid_explore_device(dev); … … 127 127 assert(usb_mid); 128 128 129 usb_log_info("USB MID gone: `%s'.\n", d ev->ddf_dev->name);129 usb_log_info("USB MID gone: `%s'.\n", ddf_dev_get_name(dev->ddf_dev)); 130 130 131 131 /* Remove ctl function */ -
uspace/drv/bus/usb/usbmid/usbmid.c
rbe2a38ad r56fd7cf 30 30 * @{ 31 31 */ 32 33 /* XXX Fix this */ 34 #define _DDF_DATA_IMPLANT 35 32 36 /** 33 37 * @file … … 47 51 static int usb_iface_get_interface_impl(ddf_fun_t *fun, int *iface_no) 48 52 { 49 assert(fun); 50 51 usbmid_interface_t *iface = fun->driver_data; 53 usbmid_interface_t *iface = ddf_fun_data_get(fun); 52 54 assert(iface); 53 55 … … 123 125 } 124 126 127 match_id_list_t match_ids; 128 init_match_ids(&match_ids); 129 125 130 rc = usb_device_create_match_ids_from_interface(device_descriptor, 126 interface_descriptor, & child->match_ids);131 interface_descriptor, &match_ids); 127 132 if (rc != EOK) { 128 133 ddf_fun_destroy(child); 129 134 return rc; 130 135 } 136 137 list_foreach(match_ids.ids, link) { 138 match_id_t *match_id = list_get_instance(link, match_id_t, link); 139 rc = ddf_fun_add_match_id(child, match_id->id, match_id->score); 140 if (rc != EOK) { 141 clean_match_ids(&match_ids); 142 ddf_fun_destroy(child); 143 return rc; 144 } 145 } 146 clean_match_ids(&match_ids); 131 147 132 148 rc = ddf_fun_bind(child); … … 138 154 139 155 iface->fun = child; 140 child->driver_data = iface;141 child->ops = &child_device_ops;156 ddf_fun_data_implant(child, iface); 157 ddf_fun_set_ops(child, &child_device_ops); 142 158 143 159 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.
