Changes in uspace/lib/usb/src/hcdhubd.c [1f43c8f:fe5e00d6] in mainline
- File:
-
- 1 edited
-
uspace/lib/usb/src/hcdhubd.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hcdhubd.c
r1f43c8f rfe5e00d6 40 40 #include <bool.h> 41 41 #include <errno.h> 42 #include <str_error.h>43 42 #include <usb/classes/hub.h> 44 43 … … 113 112 } 114 113 115 rc = usb_hc_add_child_device(dev->generic, USB_HUB_DEVICE_NAME, id , true);114 rc = usb_hc_add_child_device(dev->generic, USB_HUB_DEVICE_NAME, id); 116 115 if (rc != EOK) { 117 116 free(id); … … 151 150 match_id->id = child_info->match_id; 152 151 match_id->score = 10; 152 printf("adding child device with match \"%s\"\n", match_id->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);157 155 rc = child_device_register(child, child_info->parent); 158 printf("%s: child device `%s' registration: %s\n",159 hc_driver->name, child->name, str_error(rc));160 161 156 if (rc != EOK) { 162 157 goto failure; … … 178 173 leave: 179 174 free(arg); 180 return EOK;175 return rc; 181 176 } 182 177 … … 185 180 * driven by the same task, the child adding is done in separate fibril. 186 181 * 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.189 182 * 190 183 * @param parent Parent device. 191 184 * @param name Device name. 192 185 * @param match_id Match id. 193 * @param create_fibril Whether to run the addition in new fibril.194 186 * @return Error code. 195 187 */ 196 188 int usb_hc_add_child_device(device_t *parent, const char *name, 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 189 const char *match_id) 190 { 202 191 struct child_device_info *child_info 203 192 = malloc(sizeof(struct child_device_info)); … … 207 196 child_info->match_id = match_id; 208 197 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 } 198 fid_t fibril = fibril_create(fibril_add_child_device, child_info); 199 if (!fibril) { 200 return ENOMEM; 201 } 202 fibril_add_ready(fibril); 218 203 219 204 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.
