[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 30/55] auxbus: New aux_realize_bus(), pairing with aux_init_b
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 30/55] auxbus: New aux_realize_bus(), pairing with aux_init_bus() |
Date: |
Tue, 26 May 2020 13:54:59 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 5/19/20 4:55 PM, Markus Armbruster wrote:
> aux_init_bus() encapsulates the creation of an aux-bus and its
> aux-to-i2c-bridge device.
>
> Create aux_realize_bus() to similarly encapsulate their realization.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> include/hw/misc/auxbus.h | 7 +++++++
> hw/display/xlnx_dp.c | 2 +-
> hw/misc/auxbus.c | 5 +++++
> 3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/include/hw/misc/auxbus.h b/include/hw/misc/auxbus.h
> index a539a98c4b..6ab6cf5bb6 100644
> --- a/include/hw/misc/auxbus.h
> +++ b/include/hw/misc/auxbus.h
> @@ -93,6 +93,13 @@ struct AUXSlave {
> */
> AUXBus *aux_init_bus(DeviceState *parent, const char *name);
Previous to your patch, but aux_init_bus() is misnamed.
I'd rather rename this one aux_bus_init() ...
>
> +/**
> + * aux_realize_bus: Realize an AUX bus.
> + *
> + * @bus: The AUX bus.
> + */
> +void aux_realize_bus(AUXBus *bus);
... and this one aux_bus_realize().
If you mind :)
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> +
> /*
> * aux_request: Make a request on the bus.
> *
> diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
> index dd6aa172f3..b1d90cab1d 100644
> --- a/hw/display/xlnx_dp.c
> +++ b/hw/display/xlnx_dp.c
> @@ -1264,7 +1264,7 @@ static void xlnx_dp_realize(DeviceState *dev, Error
> **errp)
> DisplaySurface *surface;
> struct audsettings as;
>
> - qdev_init_nofail(DEVICE(s->aux_bus->bridge));
> + aux_realize_bus(s->aux_bus);
>
> qdev_init_nofail(DEVICE(s->dpcd));
> aux_map_slave(AUX_SLAVE(s->dpcd), 0x0000);
> diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c
> index 7fb020086f..9b4ccfa39c 100644
> --- a/hw/misc/auxbus.c
> +++ b/hw/misc/auxbus.c
> @@ -81,6 +81,11 @@ AUXBus *aux_init_bus(DeviceState *parent, const char *name)
> return bus;
> }
>
> +void aux_realize_bus(AUXBus *bus)
> +{
> + qdev_init_nofail(DEVICE(bus->bridge));
> +}
> +
> void aux_map_slave(AUXSlave *aux_dev, hwaddr addr)
> {
> DeviceState *dev = DEVICE(aux_dev);
>
- [PATCH 06/55] qdev: Convert to qdev_unrealize() with Coccinelle, (continued)
- [PATCH 06/55] qdev: Convert to qdev_unrealize() with Coccinelle, Markus Armbruster, 2020/05/19
- [PATCH 13/55] hw/ppc: Eliminate two superfluous QOM casts, Markus Armbruster, 2020/05/19
- [PATCH 19/55] isa: Convert uses of isa_create(), isa_try_create() manually, Markus Armbruster, 2020/05/19
- [PATCH 20/55] isa: isa_create(), isa_try_create() are now unused, drop, Markus Armbruster, 2020/05/19
- [PATCH 09/55] qdev: Convert uses of qdev_create() manually, Markus Armbruster, 2020/05/19
- [PATCH 31/55] auxbus: Convert a use of qdev_set_parent_bus(), Markus Armbruster, 2020/05/19
- [PATCH 23/55] ssi: Convert last use of ssi_create_slave_no_init() manually, Markus Armbruster, 2020/05/19
- [PATCH 30/55] auxbus: New aux_realize_bus(), pairing with aux_init_bus(), Markus Armbruster, 2020/05/19
- Re: [PATCH 30/55] auxbus: New aux_realize_bus(), pairing with aux_init_bus(),
Philippe Mathieu-Daudé <=
- [PATCH 11/55] qdev: Convert uses of qdev_set_parent_bus() manually, Markus Armbruster, 2020/05/19
- [PATCH 32/55] auxbus: Eliminate aux_create_slave(), Markus Armbruster, 2020/05/19
- [PATCH 18/55] isa: Convert uses of isa_create() with Coccinelle, Markus Armbruster, 2020/05/19
- [PATCH 33/55] qom: Tidy up a few object_initialize_child() calls, Markus Armbruster, 2020/05/19
- [PATCH 12/55] pci: New pci_new(), pci_realize_and_unref() etc., Markus Armbruster, 2020/05/19
- [PATCH 38/55] microbit: Tidy up sysbus_init_child_obj() @child argument, Markus Armbruster, 2020/05/19