aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/bus.c4
-rw-r--r--hw/usb/dev-bluetooth.c6
-rw-r--r--hw/usb/dev-network.c3
-rw-r--r--hw/usb/dev-serial.c3
-rw-r--r--hw/usb/dev-storage.c3
5 files changed, 1 insertions, 18 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 986b2d8da8..eeb6872324 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -320,10 +320,6 @@ USBDevice *usb_create_simple(USBBus *bus, const char *name)
USBDevice *dev = usb_create(bus, name);
int rc;
- if (!dev) {
- error_report("Failed to create USB device '%s'", name);
- return NULL;
- }
rc = qdev_init(&dev->qdev);
if (rc < 0) {
error_report("Failed to initialize USB device '%s'", name);
diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
index 390d475c16..8b3b31694b 100644
--- a/hw/usb/dev-bluetooth.c
+++ b/hw/usb/dev-bluetooth.c
@@ -530,14 +530,10 @@ static USBDevice *usb_bt_init(USBBus *bus, const char *cmdline)
} else {
hci = bt_new_hci(qemu_find_bt_vlan(0));
}
-
if (!hci)
return NULL;
+
dev = usb_create(bus, name);
- if (!dev) {
- error_report("Failed to create USB device '%s'", name);
- return NULL;
- }
s = DO_UPCAST(struct USBBtState, dev, dev);
s->hci = hci;
if (qdev_init(&dev->qdev) < 0) {
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index 5b95d5c382..620fc116cf 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -1405,9 +1405,6 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline)
}
dev = usb_create(bus, "usb-net");
- if (!dev) {
- return NULL;
- }
qdev_set_nic_properties(&dev->qdev, &nd_table[idx]);
qdev_init_nofail(&dev->qdev);
return dev;
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index 1cee450259..f347c05b54 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -544,9 +544,6 @@ static USBDevice *usb_serial_init(USBBus *bus, const char *filename)
return NULL;
dev = usb_create(bus, "usb-serial");
- if (!dev) {
- return NULL;
- }
qdev_prop_set_chr(&dev->qdev, "chardev", cdrv);
if (vendorid)
qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid);
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 4539733e42..5f222754ba 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -706,9 +706,6 @@ static USBDevice *usb_msd_init(USBBus *bus, const char *filename)
/* create guest device */
dev = usb_create(bus, "usb-storage");
- if (!dev) {
- return NULL;
- }
if (qdev_prop_set_drive(&dev->qdev, "drive",
blk_by_legacy_dinfo(dinfo)) < 0) {
object_unparent(OBJECT(dev));