Changes in uspace/drv/root/root.c [f0da4eb2:7e752b2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/root/root.c
rf0da4eb2 r7e752b2 45 45 #include <ctype.h> 46 46 #include <macros.h> 47 #include <inttypes.h> 47 48 48 49 #include <driver.h> … … 119 120 } 120 121 121 /** Create virtual USB host controller device.122 * Note that the virtual HC is actually device and driver in one123 * task.124 *125 * @param parent Parent device.126 * @return Error code.127 */128 static int add_virtual_usb_host_controller(device_t *parent)129 {130 printf(NAME ": adding virtual host contoller.\n");131 132 int rc;133 device_t *vhc = NULL;134 match_id_t *match_id = NULL;135 136 vhc = create_device();137 if (vhc == NULL) {138 rc = ENOMEM;139 goto failure;140 }141 142 vhc->name = "vhc";143 printf(NAME ": the new device's name is %s.\n", vhc->name);144 145 /* Initialize match id list. */146 match_id = create_match_id();147 if (match_id == NULL) {148 rc = ENOMEM;149 goto failure;150 }151 152 match_id->id = "usb&hc=vhc";153 match_id->score = 100;154 add_match_id(&vhc->match_ids, match_id);155 156 /* Register child device. */157 rc = child_device_register(vhc, parent);158 if (rc != EOK)159 goto failure;160 161 return EOK;162 163 failure:164 if (match_id != NULL)165 match_id->id = NULL;166 167 if (vhc != NULL) {168 vhc->name = NULL;169 delete_device(vhc);170 }171 172 return rc;173 }174 175 122 /** Get the root device. 176 123 * … … 180 127 static int root_add_device(device_t *dev) 181 128 { 182 printf(NAME ": root_add_device, device handle = %d\n", dev->handle); 129 printf(NAME ": root_add_device, device handle=%" PRIun "\n", 130 dev->handle); 183 131 184 132 /* Register root device's children. */ … … 187 135 printf(NAME ": failed to add child device for platform.\n"); 188 136 189 /* Register virtual USB host controller. */190 int rc = add_virtual_usb_host_controller(dev);191 if (EOK != rc) {192 printf(NAME ": failed to add child device - virtual USB HC.\n");193 }194 195 137 return res; 196 138 }
Note:
See TracChangeset
for help on using the changeset viewer.