diff mbox series

[3/9] hw/usb/hcd-ohci-pci: Use QOM type-safe cast conversion macro

Message ID 20230220150515.32549-4-philmd@linaro.org
State New
Headers show
Series hw/usb: Cleanups around QOM style | expand

Commit Message

Philippe Mathieu-Daudé Feb. 20, 2023, 3:05 p.m. UTC
Use the PCI_DEVICE() QOM cast macros to avoid accessing internal fields.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/usb/hcd-ohci-pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c
index 6b630d35a7..3234408f1a 100644
--- a/hw/usb/hcd-ohci-pci.c
+++ b/hw/usb/hcd-ohci-pci.c
@@ -52,11 +52,11 @@  struct OHCIPCIState {
 static void ohci_pci_die(struct OHCIState *ohci)
 {
     OHCIPCIState *dev = container_of(ohci, OHCIPCIState, state);
+    PCIDevice *pdev = PCI_DEVICE(dev);
 
     ohci_sysbus_die(ohci);
 
-    pci_set_word(dev->parent_obj.config + PCI_STATUS,
-                 PCI_STATUS_DETECTED_PARITY);
+    pci_set_word(pdev->config + PCI_STATUS, PCI_STATUS_DETECTED_PARITY);
 }
 
 static void usb_ohci_realize_pci(PCIDevice *dev, Error **errp)