Changeset 1f43c8f in mainline for uspace/lib/usb/src/hcdhubd.c
- Timestamp:
- 2010-11-28T22:14:41Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 78f01ff9, 7972b51
- Parents:
- ba7f671
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hcdhubd.c
rba7f671 r1f43c8f 113 113 } 114 114 115 rc = usb_hc_add_child_device(dev->generic, USB_HUB_DEVICE_NAME, id );115 rc = usb_hc_add_child_device(dev->generic, USB_HUB_DEVICE_NAME, id, true); 116 116 if (rc != EOK) { 117 117 free(id); … … 153 153 add_match_id(&child->match_ids, match_id); 154 154 155 printf("%s: adding child device `%s' with match \"%s\"\n", 156 hc_driver->name, child->name, match_id->id); 155 157 rc = child_device_register(child, child_info->parent); 156 printf("%s: adding child device with match \"%s\" (%s)\n", 157 hc_driver->name, match_id->id, str_error(rc)); 158 printf("%s: child device `%s' registration: %s\n", 159 hc_driver->name, child->name, str_error(rc)); 160 158 161 if (rc != EOK) { 159 162 goto failure; … … 175 178 leave: 176 179 free(arg); 177 return rc;180 return EOK; 178 181 } 179 182 … … 182 185 * driven by the same task, the child adding is done in separate fibril. 183 186 * Not optimal, but it works. 187 * Update: not under all circumstances the new fibril is successful either. 188 * Thus the last parameter to let the caller choose. 184 189 * 185 190 * @param parent Parent device. 186 191 * @param name Device name. 187 192 * @param match_id Match id. 193 * @param create_fibril Whether to run the addition in new fibril. 188 194 * @return Error code. 189 195 */ 190 196 int usb_hc_add_child_device(device_t *parent, const char *name, 191 const char *match_id) 192 { 197 const char *match_id, bool create_fibril) 198 { 199 printf("%s: about to add child device `%s' (%s)\n", hc_driver->name, 200 name, match_id); 201 193 202 struct child_device_info *child_info 194 203 = malloc(sizeof(struct child_device_info)); … … 198 207 child_info->match_id = match_id; 199 208 200 fid_t fibril = fibril_create(fibril_add_child_device, child_info); 201 if (!fibril) { 202 return ENOMEM; 203 } 204 fibril_add_ready(fibril); 209 if (create_fibril) { 210 fid_t fibril = fibril_create(fibril_add_child_device, child_info); 211 if (!fibril) { 212 return ENOMEM; 213 } 214 fibril_add_ready(fibril); 215 } else { 216 fibril_add_child_device(child_info); 217 } 205 218 206 219 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.