Replace accesses to qdev->parent_bus by qdev_get_parent_bus(qdev). Use the USB_BUS() QOM type-checking macro to avoid DO_UPCAST().
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> --- include/hw/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index 32c23a5ca2..f743a5e945 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -520,7 +520,7 @@ void usb_check_attach(USBDevice *dev, Error **errp); static inline USBBus *usb_bus_from_device(USBDevice *d) { - return DO_UPCAST(USBBus, qbus, d->qdev.parent_bus); + return USB_BUS(qdev_get_parent_bus(DEVICE(d))); } extern const VMStateDescription vmstate_usb_device; -- 2.38.1