diff mbox series

[03/23] hw/ppc/e500: Prefer QOM cast

Message ID 20240923093016.66437-4-shentey@gmail.com (mailing list archive)
State New, archived
Headers show
Series E500 Cleanup | expand

Commit Message

Bernhard Beschow Sept. 23, 2024, 9:29 a.m. UTC
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/ppc/e500.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

BALATON Zoltan Sept. 23, 2024, 10:07 a.m. UTC | #1
On Mon, 23 Sep 2024, Bernhard Beschow wrote:
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>

Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>

> ---
> hw/ppc/e500.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index f68779a1ea..32996c188e 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -1008,7 +1008,7 @@ void ppce500_init(MachineState *machine)
>     sysbus_connect_irq(s, 0, qdev_get_gpio_in(mpicdev, MPC8544_I2C_IRQ));
>     memory_region_add_subregion(ccsr_addr_space, MPC8544_I2C_REGS_OFFSET,
>                                 sysbus_mmio_get_region(s, 0));
> -    i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
> +    i2c = I2C_BUS(qdev_get_child_bus(dev, "i2c"));
>     i2c_slave_create_simple(i2c, "ds1338", RTC_REGS_OFFSET);
>
>     /* eSDHC */
> @@ -1057,7 +1057,7 @@ void ppce500_init(MachineState *machine)
>     memory_region_add_subregion(ccsr_addr_space, MPC8544_PCI_REGS_OFFSET,
>                                 sysbus_mmio_get_region(s, 0));
>
> -    pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
> +    pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
>     if (!pci_bus)
>         printf("couldn't create PCI controller!\n");
>
>
diff mbox series

Patch

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index f68779a1ea..32996c188e 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -1008,7 +1008,7 @@  void ppce500_init(MachineState *machine)
     sysbus_connect_irq(s, 0, qdev_get_gpio_in(mpicdev, MPC8544_I2C_IRQ));
     memory_region_add_subregion(ccsr_addr_space, MPC8544_I2C_REGS_OFFSET,
                                 sysbus_mmio_get_region(s, 0));
-    i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c");
+    i2c = I2C_BUS(qdev_get_child_bus(dev, "i2c"));
     i2c_slave_create_simple(i2c, "ds1338", RTC_REGS_OFFSET);
 
     /* eSDHC */
@@ -1057,7 +1057,7 @@  void ppce500_init(MachineState *machine)
     memory_region_add_subregion(ccsr_addr_space, MPC8544_PCI_REGS_OFFSET,
                                 sysbus_mmio_get_region(s, 0));
 
-    pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0");
+    pci_bus = PCI_BUS(qdev_get_child_bus(dev, "pci.0"));
     if (!pci_bus)
         printf("couldn't create PCI controller!\n");