diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-06-10 07:32:21 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2020-06-15 22:05:28 +0200 |
commit | b7a1b5483ee0179f0e5d31cf43678fa225227614 (patch) | |
tree | 85d76ecd34fda42f1f2f8871c30afbcac4c40945 /hw | |
parent | dbe4070e59ab86f4a25de9cd12ed56f9eb68049b (diff) |
auxbus: New aux_bus_realize(), pairing with aux_bus_init()
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>
Message-Id: <20200610053247.1583243-33-armbru@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/display/xlnx_dp.c | 2 | ||||
-rw-r--r-- | hw/misc/auxbus.c | 5 |
2 files changed, 6 insertions, 1 deletions
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 e93a35dd0a..75b6de1c63 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); |