aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/versatilepb.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-11-17 17:34:00 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-12-15 08:38:16 +0100
commitd83c29e98119570880491dacd8dbed9b45a53c5d (patch)
tree5ff926c5659d4e1e9289a4f3b4b39ccf8c05888a /hw/arm/versatilepb.c
parent93d8bc8f5bc20a3108c9c9592d43d0202778f0c5 (diff)
hw/arm/versatilepb hw/arm/vexpress: Replace drive_get_next() by drive_get()
drive_get_next() is basically a bad idea. It returns the "next" block backend of a certain interface type. "Next" means bus=0,unit=N, where subsequent calls count N up from zero, per interface type. This lets you define unit numbers implicitly by execution order. If the order changes, or new calls appear "in the middle", unit numbers change. ABI break. Hard to spot in review. The versatile and vexpress machines ("versatileab", "versatilepb", "vexpress-a9", "vexpress-a15") connect just one or two backends of a type with drive_get_next(). Change them to use drive_get() directly. This makes the unit numbers explicit in the code. Cc: Peter Maydell <peter.maydell@linaro.org> Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20211117163409.3587705-5-armbru@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm/versatilepb.c')
-rw-r--r--hw/arm/versatilepb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index 575399c4fc..ecc1f6cf74 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -310,7 +310,7 @@ static void versatile_init(MachineState *machine, int board_id)
qdev_connect_gpio_out(sysctl, 0, qdev_get_gpio_in(dev, 0));
dev = sysbus_create_varargs("pl181", 0x10005000, sic[22], sic[1], NULL);
- dinfo = drive_get_next(IF_SD);
+ dinfo = drive_get(IF_SD, 0, 0);
if (dinfo) {
DeviceState *card;
@@ -322,7 +322,7 @@ static void versatile_init(MachineState *machine, int board_id)
}
dev = sysbus_create_varargs("pl181", 0x1000b000, sic[23], sic[2], NULL);
- dinfo = drive_get_next(IF_SD);
+ dinfo = drive_get(IF_SD, 0, 1);
if (dinfo) {
DeviceState *card;