diff options
| author | Markus Armbruster <armbru@redhat.com> | 2015-02-17 14:28:02 +0100 |
|---|---|---|
| committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-03-17 14:11:42 +0100 |
| commit | f4bbaaf584ed8d0a430b467bace15f338cba4c57 (patch) | |
| tree | ea99c54741464dba6c0f851c6ab4673eb463a8e5 /hw/usb/hcd-uhci.c | |
| parent | 5a4992834daec85c3913654903fb9f4f954e585a (diff) | |
| download | focaccia-qemu-f4bbaaf584ed8d0a430b467bace15f338cba4c57.tar.gz focaccia-qemu-f4bbaaf584ed8d0a430b467bace15f338cba4c57.zip | |
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-uhci.c')
| -rw-r--r-- | hw/usb/hcd-uhci.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index f903de7072..2ca8de3268 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1192,6 +1192,7 @@ static USBBusOps uhci_bus_ops = { static int usb_uhci_common_initfn(PCIDevice *dev) { + Error *err = NULL; PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev); UHCIPCIDeviceClass *u = container_of(pc, UHCIPCIDeviceClass, parent_class); UHCIState *s = DO_UPCAST(UHCIState, dev, dev); @@ -1209,9 +1210,12 @@ static int usb_uhci_common_initfn(PCIDevice *dev) for(i = 0; i < NB_PORTS; i++) { ports[i] = &s->ports[i].port; } - if (usb_register_companion(s->masterbus, ports, NB_PORTS, - s->firstport, s, &uhci_port_ops, - USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL) != 0) { + usb_register_companion(s->masterbus, ports, NB_PORTS, + s->firstport, s, &uhci_port_ops, + USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL, + &err); + if (err) { + error_report_err(err); return -1; } } else { |