Changeset 15d0046 in mainline for uspace/drv/bus/usb/usbmid/usbmid.c
- Timestamp:
- 2014-09-12T13:22:33Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b20126
- Parents:
- 8db09e4 (diff), 105d8d6 (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/usbmid/usbmid.c
r8db09e4 r15d0046 30 30 * @{ 31 31 */ 32 33 /* XXX Fix this */34 #define _DDF_DATA_IMPLANT35 32 36 33 /** … … 102 99 const usb_standard_interface_descriptor_t *interface_descriptor) 103 100 { 104 ddf_fun_t *child = NULL;105 101 char *child_name = NULL; 106 102 int rc; … … 114 110 usb_str_class(interface_descriptor->interface_class), 115 111 interface_descriptor->interface_number); 116 if (rc < 0) {112 if (rc < 0) 117 113 return ENOMEM; 118 }119 114 120 /* Create the device. */ 121 child = ddf_fun_create(parent->ddf_dev, fun_inner, child_name); 115 rc = ddf_fun_set_name(iface->fun, child_name); 122 116 free(child_name); 123 if ( child == NULL) {117 if (rc != EOK) 124 118 return ENOMEM; 125 }126 119 127 120 match_id_list_t match_ids; … … 130 123 rc = usb_device_create_match_ids_from_interface(device_descriptor, 131 124 interface_descriptor, &match_ids); 132 if (rc != EOK) { 133 ddf_fun_destroy(child); 125 if (rc != EOK) 134 126 return rc; 135 }136 127 137 128 list_foreach(match_ids.ids, link, match_id_t, match_id) { 138 rc = ddf_fun_add_match_id( child, match_id->id, match_id->score);129 rc = ddf_fun_add_match_id(iface->fun, match_id->id, match_id->score); 139 130 if (rc != EOK) { 140 131 clean_match_ids(&match_ids); 141 ddf_fun_destroy(child);142 132 return rc; 143 133 } … … 145 135 clean_match_ids(&match_ids); 146 136 147 rc = ddf_fun_bind(child);148 if (rc != EOK) { 149 /* This takes care of match_id deallocation as well. */150 ddf_fun_destroy(child);137 ddf_fun_set_ops(iface->fun, &child_device_ops); 138 139 rc = ddf_fun_bind(iface->fun); 140 if (rc != EOK) 151 141 return rc; 152 }153 154 iface->fun = child;155 ddf_fun_data_implant(child, iface);156 ddf_fun_set_ops(child, &child_device_ops);157 142 158 143 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.