[PATCH v2 04/13] hw/ppc/e500: Reduce usage of sysbus API

Bernhard Beschow posted 13 patches 3 years, 4 months ago
Maintainers: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Bin Meng <bin.meng@windriver.com>
There is a newer version of this series
[PATCH v2 04/13] hw/ppc/e500: Reduce usage of sysbus API
Posted by Bernhard Beschow 3 years, 4 months ago
PlatformBusDevice has an mmio attribute which gets aliased to
SysBusDevice::mmio[0]. So PlatformbusDevice::mmio can be used directly,
avoiding the sysbus API.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/ppc/e500.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 32495d0123..496c61b612 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -1023,7 +1023,7 @@ void ppce500_init(MachineState *machine)
 
         memory_region_add_subregion(address_space_mem,
                                     pmc->platform_bus_base,
-                                    sysbus_mmio_get_region(s, 0));
+                                    &pms->pbus_dev->mmio);
     }
 
     /*
-- 
2.37.3
Re: [PATCH v2 04/13] hw/ppc/e500: Reduce usage of sysbus API
Posted by Bin Meng 3 years, 4 months ago
On Tue, Oct 4, 2022 at 5:24 AM Bernhard Beschow <shentey@gmail.com> wrote:
>
> PlatformBusDevice has an mmio attribute which gets aliased to
> SysBusDevice::mmio[0]. So PlatformbusDevice::mmio can be used directly,
> avoiding the sysbus API.
>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>  hw/ppc/e500.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Re: [PATCH v2 04/13] hw/ppc/e500: Reduce usage of sysbus API
Posted by Philippe Mathieu-Daudé via 3 years, 4 months ago
On 3/10/22 22:31, Bernhard Beschow wrote:
> PlatformBusDevice has an mmio attribute which gets aliased to
> SysBusDevice::mmio[0]. So PlatformbusDevice::mmio can be used directly,
> avoiding the sysbus API.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   hw/ppc/e500.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>