summaryrefslogtreecommitdiff
path: root/hw/usb/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/bus.c')
-rw-r--r--hw/usb/bus.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 91fc3e20d9..98e33ea31a 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -360,9 +360,10 @@ void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
bus->nfree++;
}
-int usb_register_companion(const char *masterbus, USBPort *ports[],
- uint32_t portcount, uint32_t firstport,
- void *opaque, USBPortOps *ops, int speedmask)
+void usb_register_companion(const char *masterbus, USBPort *ports[],
+ uint32_t portcount, uint32_t firstport,
+ void *opaque, USBPortOps *ops, int speedmask,
+ Error **errp)
{
USBBus *bus;
int i;
@@ -374,21 +375,23 @@ int usb_register_companion(const char *masterbus, USBPort *ports[],
}
if (!bus || !bus->ops->register_companion) {
- qerror_report(QERR_INVALID_PARAMETER_VALUE, "masterbus",
- "an USB masterbus");
+ error_set(errp, QERR_INVALID_PARAMETER_VALUE, "masterbus",
+ "an USB masterbus");
+#if 0 /* conversion from qerror_report() to error_set() broke this: */
if (bus) {
error_printf_unless_qmp(
"USB bus '%s' does not allow companion controllers\n",
masterbus);
}
- return -1;
+#endif
+ return;
}
for (i = 0; i < portcount; i++) {
usb_fill_port(ports[i], opaque, i, ops, speedmask);
}
- return bus->ops->register_companion(bus, ports, portcount, firstport);
+ bus->ops->register_companion(bus, ports, portcount, firstport, errp);
}
void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)