OSDN Git Service

hw/arm/xilinx_zynq: Replace drive_get_next() by drive_get()
authorMarkus Armbruster <armbru@redhat.com>
Wed, 17 Nov 2021 16:34:07 +0000 (17:34 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 15 Dec 2021 13:55:40 +0000 (14:55 +0100)
commit94d4bb4ff9c557dcb68cd16a287700dd9218bd1c
tree032c89fdee58d502bdcba17636f8667e7ae0e163
parent97ca6c2786e5dd1fd689c52ffe0cb082bc8bd477
hw/arm/xilinx_zynq: 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 "xlnx-zcu102" connects backends with drive_get_next() in two
counting loops, one of them in a helper function.  Change it to use
drive_get() directly.  This makes the unit numbers explicit in the
code.

Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: Alistair Francis <alistair@alistair23.me>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20211117163409.3587705-12-armbru@redhat.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
hw/arm/xilinx_zynq.c