hw/arm/mcimx6ul-evk: Replace drive_get_next() by drive_get()
commit8acf052f7a70df88c01feccd8992eb50afce1b1d
authorMarkus Armbruster <armbru@redhat.com>
Wed, 17 Nov 2021 16:34:02 +0000 (17 17:34 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 15 Dec 2021 07:38:16 +0000 (15 08:38 +0100)
tree1b18f38b21bfedf58441aa68d152aa0eeeae973b
parent6b87668b0813b9cb5ec714dcbcd8f128cfc4a3b1
hw/arm/mcimx6ul-evk: 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 "mcimx6ul-evk" 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: Peter Maydell <peter.maydell@linaro.org>
Cc: Jean-Christophe Dubois <jcd@tribudubois.net>
Cc: qemu-arm@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20211117163409.3587705-7-armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/mcimx6ul-evk.c