diff mbox series

[v2,6/9] hw/ppc: Replace dev->parent_bus by qdev_get_parent_bus(dev)

Message ID 20230213070423.76428-7-philmd@linaro.org
State New
Headers show
Series hw/qdev: Housekeeping around qdev_get_parent_bus() | expand

Commit Message

Philippe Mathieu-Daudé Feb. 13, 2023, 7:04 a.m. UTC
DeviceState::parent_bus is an internal field and should be
accessed by the qdev_get_parent_bus() helper.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/spapr_vio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Cédric Le Goater Feb. 13, 2023, 7:32 a.m. UTC | #1
On 2/13/23 08:04, Philippe Mathieu-Daudé wrote:
> DeviceState::parent_bus is an internal field and should be
> accessed by the qdev_get_parent_bus() helper.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>   hw/ppc/spapr_vio.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
> index 9d4fec2c04..dfc5c436bd 100644
> --- a/hw/ppc/spapr_vio.c
> +++ b/hw/ppc/spapr_vio.c
> @@ -382,7 +382,7 @@ static void rtas_quiesce(PowerPCCPU *cpu, SpaprMachineState *spapr,
>   
>   static SpaprVioDevice *reg_conflict(SpaprVioDevice *dev)
>   {
> -    SpaprVioBus *bus = SPAPR_VIO_BUS(dev->qdev.parent_bus);
> +    SpaprVioBus *bus = SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev)));
>       BusChild *kid;
>       SpaprVioDevice *other;
>   
> @@ -492,7 +492,7 @@ static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
>           }
>       } else {
>           /* Need to assign an address */
> -        SpaprVioBus *bus = SPAPR_VIO_BUS(dev->qdev.parent_bus);
> +        SpaprVioBus *bus = SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev)));
>   
>           do {
>               dev->reg = bus->next_reg++;
diff mbox series

Patch

diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index 9d4fec2c04..dfc5c436bd 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -382,7 +382,7 @@  static void rtas_quiesce(PowerPCCPU *cpu, SpaprMachineState *spapr,
 
 static SpaprVioDevice *reg_conflict(SpaprVioDevice *dev)
 {
-    SpaprVioBus *bus = SPAPR_VIO_BUS(dev->qdev.parent_bus);
+    SpaprVioBus *bus = SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev)));
     BusChild *kid;
     SpaprVioDevice *other;
 
@@ -492,7 +492,7 @@  static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
         }
     } else {
         /* Need to assign an address */
-        SpaprVioBus *bus = SPAPR_VIO_BUS(dev->qdev.parent_bus);
+        SpaprVioBus *bus = SPAPR_VIO_BUS(qdev_get_parent_bus(DEVICE(dev)));
 
         do {
             dev->reg = bus->next_reg++;