Loading hw/usb-bus.c +15 −3 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ static void usb_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent); static char *usb_get_dev_path(DeviceState *dev); static char *usb_get_fw_dev_path(DeviceState *qdev); static int usb_qdev_exit(DeviceState *qdev); static struct BusInfo usb_bus_info = { .name = "USB", Loading Loading @@ -75,12 +76,23 @@ static int usb_qdev_init(DeviceState *qdev, DeviceInfo *base) dev->auto_attach = 1; QLIST_INIT(&dev->strings); rc = usb_claim_port(dev); if (rc == 0) { if (rc != 0) { goto err; } rc = dev->info->init(dev); if (rc != 0) { goto err; } if (rc == 0 && dev->auto_attach) { if (dev->auto_attach) { rc = usb_device_attach(dev); if (rc != 0) { goto err; } } return 0; err: usb_qdev_exit(qdev); return rc; } Loading Loading
hw/usb-bus.c +15 −3 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ static void usb_bus_dev_print(Monitor *mon, DeviceState *qdev, int indent); static char *usb_get_dev_path(DeviceState *dev); static char *usb_get_fw_dev_path(DeviceState *qdev); static int usb_qdev_exit(DeviceState *qdev); static struct BusInfo usb_bus_info = { .name = "USB", Loading Loading @@ -75,12 +76,23 @@ static int usb_qdev_init(DeviceState *qdev, DeviceInfo *base) dev->auto_attach = 1; QLIST_INIT(&dev->strings); rc = usb_claim_port(dev); if (rc == 0) { if (rc != 0) { goto err; } rc = dev->info->init(dev); if (rc != 0) { goto err; } if (rc == 0 && dev->auto_attach) { if (dev->auto_attach) { rc = usb_device_attach(dev); if (rc != 0) { goto err; } } return 0; err: usb_qdev_exit(qdev); return rc; } Loading