]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm: spi: Correct handling of SPI chip selects in sandbox
authorSimon Glass <sjg@chromium.org>
Tue, 11 Nov 2014 17:46:22 +0000 (10:46 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 22 Nov 2014 09:16:47 +0000 (10:16 +0100)
This code was not updated when the chip select handling was adjusted. Fix
it to call the correct function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
drivers/mtd/spi/sandbox.c
drivers/spi/spi-uclass.c
include/spi.h

index 1cf2f98310a17493a5a99cce29caa652cb9aabd1..fecf6d4bc34283739aac742e38dcd05ba6bb56b9 100644 (file)
@@ -602,7 +602,7 @@ static int sandbox_sf_bind_bus_cs(struct sandbox_state *state, int busnum,
                       spec, ret);
                return ret;
        }
-       ret = device_find_child_by_seq(bus, cs, true, &slave);
+       ret = spi_find_chip_select(bus, cs, &slave);
        if (!ret) {
                printf("Chip select %d already exists for spec '%s'\n", cs,
                       spec);
index 13c6b77d73df350f943b1dd3c77ce8c7e0fef0c3..6bfc274956da1a146f0420f5e6213c48e996f35f 100644 (file)
@@ -115,16 +115,7 @@ int spi_chip_select(struct udevice *dev)
        return slave ? slave->cs : -ENOENT;
 }
 
-/**
- * spi_find_chip_select() - Find the slave attached to chip select
- *
- * @bus:       SPI bus to search
- * @cs:                Chip select to look for
- * @devp:      Returns the slave device if found
- * @return 0 if found, -ENODEV on error
- */
-static int spi_find_chip_select(struct udevice *bus, int cs,
-                               struct udevice **devp)
+int spi_find_chip_select(struct udevice *bus, int cs, struct udevice **devp)
 {
        struct udevice *dev;
 
index aa0a48ea62710dd019c77c75cc5350a9f61fb14d..5975cda8653a87c2a044d20908cb5900052ebcc6 100644 (file)
@@ -533,6 +533,16 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
  */
 int spi_chip_select(struct udevice *slave);
 
+/**
+ * spi_find_chip_select() - Find the slave attached to chip select
+ *
+ * @bus:       SPI bus to search
+ * @cs:                Chip select to look for
+ * @devp:      Returns the slave device if found
+ * @return 0 if found, -ENODEV on error
+ */
+int spi_find_chip_select(struct udevice *bus, int cs, struct udevice **devp);
+
 /**
  * spi_bind_device() - bind a device to a bus's chip select
  *