dm: spi: Do not assume first SPI bus
authorThomas Fitzsimmons <fitzsim@fitzsim.org>
Fri, 6 Sep 2019 11:51:19 +0000 (07:51 -0400)
committerSimon Glass <sjg@chromium.org>
Tue, 15 Oct 2019 14:40:02 +0000 (08:40 -0600)
When CONFIG_OF_PRIOR_STAGE is enabled, this workaround was needed
before device_bind_common assigned request numbers sequentially in the
absence of aliases.

Signed-off-by: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
drivers/spi/spi-uclass.c

index 76c4b53c165c764e496a40c101e6e34c65b8a887..a4d1b65682d1e75d4ccac2b38c90f2f1f005a124 100644 (file)
@@ -299,7 +299,7 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
        bool created = false;
        int ret;
 
-#if CONFIG_IS_ENABLED(OF_PLATDATA) || CONFIG_IS_ENABLED(OF_PRIOR_STAGE)
+#if CONFIG_IS_ENABLED(OF_PLATDATA)
        ret = uclass_first_device_err(UCLASS_SPI, &bus);
 #else
        ret = uclass_get_device_by_seq(UCLASS_SPI, busnum, &bus);