diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2015-07-17 11:34:11 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-07-17 13:19:59 +0200 |
commit | cfda2cef3d0320d7a133600ffdb6e33547aaba8f (patch) | |
tree | 8d1ff9b1b633cc0a8466c4996d73459e90b220ce /hw/usb/dev-smartcard-reader.c | |
parent | 6110ce59af199194ef63cb31ec722487df3f42fe (diff) |
usb-ccid: fix 61b4887b41b270bc837ead57bc502d904af023bb
QOMification dropped the parent device lookup, fix it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/dev-smartcard-reader.c')
-rw-r--r-- | hw/usb/dev-smartcard-reader.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index de534bab37..904b568ddd 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -1184,7 +1184,7 @@ void ccid_card_send_apdu_to_guest(CCIDCardState *card, uint8_t *apdu, uint32_t len) { DeviceState *qdev = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); Answer *answer; @@ -1207,7 +1207,7 @@ void ccid_card_send_apdu_to_guest(CCIDCardState *card, void ccid_card_card_removed(CCIDCardState *card) { DeviceState *qdev = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); ccid_on_slot_change(s, false); @@ -1218,7 +1218,7 @@ void ccid_card_card_removed(CCIDCardState *card) int ccid_card_ccid_attach(CCIDCardState *card) { DeviceState *qdev = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); DPRINTF(s, 1, "CCID Attach\n"); @@ -1231,7 +1231,7 @@ int ccid_card_ccid_attach(CCIDCardState *card) void ccid_card_ccid_detach(CCIDCardState *card) { DeviceState *qdev = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); DPRINTF(s, 1, "CCID Detach\n"); @@ -1244,7 +1244,7 @@ void ccid_card_ccid_detach(CCIDCardState *card) void ccid_card_card_error(CCIDCardState *card, uint64_t error) { DeviceState *qdev = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); s->bmCommandStatus = COMMAND_STATUS_FAILED; @@ -1263,7 +1263,7 @@ void ccid_card_card_error(CCIDCardState *card, uint64_t error) void ccid_card_card_inserted(CCIDCardState *card) { DeviceState *qdev = DEVICE(card); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); s->bmCommandStatus = COMMAND_STATUS_NO_ERROR; @@ -1275,7 +1275,7 @@ static int ccid_card_exit(DeviceState *qdev) { int ret = 0; CCIDCardState *card = CCID_CARD(qdev); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); if (ccid_card_inserted(s)) { @@ -1289,7 +1289,7 @@ static int ccid_card_exit(DeviceState *qdev) static int ccid_card_init(DeviceState *qdev) { CCIDCardState *card = CCID_CARD(qdev); - USBDevice *dev = USB_DEVICE(qdev); + USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); int ret = 0; |