aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-11-17 17:34:05 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-12-15 08:38:16 +0100
commit0de89a863292836e6efb0c40c6f9221c89a2033a (patch)
treeb6e5b8f50d8a1afce2f3cce2e255fe313c2cd9e0
parentc29faeda3f7e770e463a58f7b5b34b409dba6c88 (diff)
downloadqemu-0de89a863292836e6efb0c40c6f9221c89a2033a.zip
qemu-0de89a863292836e6efb0c40c6f9221c89a2033a.tar.gz
qemu-0de89a863292836e6efb0c40c6f9221c89a2033a.tar.bz2
hw/microblaze: 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. Machine "petalogix-ml605" connects backends with drive_get_next() in a counting loop. Change it to use drive_get() directly. This makes the unit numbers explicit in the code. Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20211117163409.3587705-10-armbru@redhat.com> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
-rw-r--r--hw/microblaze/petalogix_ml605_mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index 159db6c..a24fadd 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -183,7 +183,7 @@ petalogix_ml605_init(MachineState *machine)
spi = (SSIBus *)qdev_get_child_bus(dev, "spi");
for (i = 0; i < NUM_SPI_FLASHES; i++) {
- DriveInfo *dinfo = drive_get_next(IF_MTD);
+ DriveInfo *dinfo = drive_get(IF_MTD, 0, i);
qemu_irq cs_line;
dev = qdev_new("n25q128");