qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Philippe Mathieu-Daudé
Subject: [PATCH 3/9] hw/usb/hcd-ohci-pci: Use QOM type-safe cast conversion macro
Date: Mon, 20 Feb 2023 16:05:09 +0100

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 --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)
-- 
2.38.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]