aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/hcd-ohci.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-02-17 14:28:02 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-03-17 14:11:42 +0100
commitf4bbaaf584ed8d0a430b467bace15f338cba4c57 (patch)
treeea99c54741464dba6c0f851c6ab4673eb463a8e5 /hw/usb/hcd-ohci.c
parent5a4992834daec85c3913654903fb9f4f954e585a (diff)
downloadqemu-f4bbaaf584ed8d0a430b467bace15f338cba4c57.zip
qemu-f4bbaaf584ed8d0a430b467bace15f338cba4c57.tar.gz
qemu-f4bbaaf584ed8d0a430b467bace15f338cba4c57.tar.bz2
usb: Propagate errors through usb_register_companion()
This loses the messages explaining the error printed with error_printf_unless_qmp(). The next commit will make up for the loss. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ohci.c')
-rw-r--r--hw/usb/hcd-ohci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index a0d478e..21ec65f 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1832,6 +1832,7 @@ static int usb_ohci_init(OHCIState *ohci, DeviceState *dev,
char *masterbus, uint32_t firstport,
AddressSpace *as)
{
+ Error *err = NULL;
int i;
ohci->as = as;
@@ -1857,9 +1858,12 @@ static int usb_ohci_init(OHCIState *ohci, DeviceState *dev,
for(i = 0; i < num_ports; i++) {
ports[i] = &ohci->rhport[i].port;
}
- if (usb_register_companion(masterbus, ports, num_ports,
- firstport, ohci, &ohci_port_ops,
- USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL) != 0) {
+ usb_register_companion(masterbus, ports, num_ports,
+ firstport, ohci, &ohci_port_ops,
+ USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL,
+ &err);
+ if (err) {
+ error_report_err(err);
return -1;
}
} else {