[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 32/39] auxbus: New aux_bus_realize(), pairing with aux_bus_ini
From: |
Markus Armbruster |
Subject: |
[PATCH v3 32/39] auxbus: New aux_bus_realize(), pairing with aux_bus_init() |
Date: |
Tue, 9 Jun 2020 18:39:25 +0200 |
aux_bus_init() encapsulates the creation of an aux-bus and its
aux-to-i2c-bridge device.
Create aux_bus_realize() to similarly encapsulate their realization.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
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 5cfd7a9284..0d849d9d89 100644
--- a/include/hw/misc/auxbus.h
+++ b/include/hw/misc/auxbus.h
@@ -93,6 +93,13 @@ struct AUXSlave {
*/
AUXBus *aux_bus_init(DeviceState *parent, const char *name);
+/**
+ * aux_bus_realize: Realize an AUX bus.
+ *
+ * @bus: The AUX bus.
+ */
+void aux_bus_realize(AUXBus *bus);
+
/*
* aux_request: Make a request on the bus.
*
diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
index 31d0c5a101..a714cf8a50 100644
--- a/hw/display/xlnx_dp.c
+++ b/hw/display/xlnx_dp.c
@@ -1266,7 +1266,7 @@ static void xlnx_dp_realize(DeviceState *dev, Error
**errp)
DisplaySurface *surface;
struct audsettings as;
- qdev_init_nofail(DEVICE(s->aux_bus->bridge));
+ aux_bus_realize(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 2e1c27e842..113f4278aa 100644
--- a/hw/misc/auxbus.c
+++ b/hw/misc/auxbus.c
@@ -81,6 +81,11 @@ AUXBus *aux_bus_init(DeviceState *parent, const char *name)
return bus;
}
+void aux_bus_realize(AUXBus *bus)
+{
+ qdev_init_nofail(DEVICE(bus->bridge));
+}
+
void aux_map_slave(AUXSlave *aux_dev, hwaddr addr)
{
DeviceState *dev = DEVICE(aux_dev);
--
2.26.2
- [PATCH v3 21/39] isa: isa_create(), isa_try_create() are now unused, drop, (continued)
- [PATCH v3 21/39] isa: isa_create(), isa_try_create() are now unused, drop, Markus Armbruster, 2020/06/09
- [PATCH v3 24/39] ssi: Convert last use of ssi_create_slave_no_init() manually, Markus Armbruster, 2020/06/09
- [PATCH v3 18/39] isa: New isa_new(), isa_realize_and_unref() etc., Markus Armbruster, 2020/06/09
- [PATCH v3 30/39] qdev: qdev_create(), qdev_try_create() are now unused, drop, Markus Armbruster, 2020/06/09
- [PATCH v3 25/39] ssi: ssi_create_slave_no_init() is now unused, drop, Markus Armbruster, 2020/06/09
- [PATCH v3 19/39] isa: Convert uses of isa_create() with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 15/39] pci: Convert uses of pci_create() etc. with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 23/39] ssi: Convert uses of ssi_create_slave_no_init() with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 08/39] qdev: Convert to qdev_unrealize() manually, Markus Armbruster, 2020/06/09
- [PATCH v3 12/39] qdev: Convert uses of qdev_set_parent_bus() manually, Markus Armbruster, 2020/06/09
- [PATCH v3 32/39] auxbus: New aux_bus_realize(), pairing with aux_bus_init(),
Markus Armbruster <=
- [PATCH v3 37/39] macio: Convert use of qdev_set_parent_bus(), Markus Armbruster, 2020/06/09
- [PATCH v3 35/39] qom: Tidy up a few object_initialize_child() calls, Markus Armbruster, 2020/06/09
- [PATCH v3 26/39] usb: New usb_new(), usb_realize_and_unref(), Markus Armbruster, 2020/06/09
- [PATCH v3 09/39] qdev: Convert uses of qdev_create() with Coccinelle, Markus Armbruster, 2020/06/09
- [PATCH v3 02/39] Revert "hw/prep: realize the PCI root bus as part of the prep init", Markus Armbruster, 2020/06/09
- [PATCH v3 38/39] macio: Eliminate macio_init_child_obj(), Markus Armbruster, 2020/06/09
- [PATCH v3 34/39] auxbus: Eliminate aux_create_slave(), Markus Armbruster, 2020/06/09
- [PATCH v3 28/39] usb: usb_create() is now unused, drop, Markus Armbruster, 2020/06/09
- [PATCH v3 33/39] auxbus: Convert a use of qdev_set_parent_bus(), Markus Armbruster, 2020/06/09
- [PATCH v3 29/39] usb: Eliminate usb_try_create_simple(), Markus Armbruster, 2020/06/09