Changes in uspace/drv/bus/usb/vhc/hub/virthub.c [33b8d024:58563585] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/hub/virthub.c
r33b8d024 r58563585 42 42 #include <stdio.h> 43 43 #include <stdlib.h> 44 #include <str.h>45 44 #include <ddf/driver.h> 46 45 … … 148 147 * @return Error code. 149 148 */ 150 errno_t virthub_init(usbvirt_device_t *dev, const char* name)149 int virthub_init(usbvirt_device_t *dev, const char* name) 151 150 { 152 151 if (dev == NULL) { … … 156 155 dev->descriptors = &descriptors; 157 156 dev->address = 0; 158 159 char *n = str_dup(name); 160 if (!n) 157 dev->name = str_dup(name); 158 if (!dev->name) 161 159 return ENOMEM; 162 160 163 161 hub_t *hub = malloc(sizeof(hub_t)); 164 162 if (hub == NULL) { 165 free( n);163 free(dev->name); 166 164 return ENOMEM; 167 165 } 168 166 169 dev->name = n;170 167 hub_init(hub); 171 168 dev->device_data = hub; … … 200 197 * @return Error code. 201 198 */ 202 errno_t virthub_disconnect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn)199 int virthub_disconnect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn) 203 200 { 204 201 assert(dev != NULL);
Note:
See TracChangeset
for help on using the changeset viewer.