summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-uclass.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-11-24 12:01:48 -0500
committerTom Rini <trini@ti.com>2014-11-24 12:01:48 -0500
commit1739564e753bc3a8097f8937a3cbe738bdaaed5d (patch)
tree56fe759e62f129dc055b6f6a22f299f6c8b5cdde /drivers/spi/spi-uclass.c
parent746667f1e56bf08d03e66a178df3c4f4f6c806e1 (diff)
parent17b28edb37a33d0c89089faf36e4edd7084f65fa (diff)
downloadu-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.zip
u-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.tar.gz
u-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.tar.bz2
Merge git://git.denx.de/u-boot-dm
Conflicts: drivers/serial/serial-uclass.c Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'drivers/spi/spi-uclass.c')
-rw-r--r--drivers/spi/spi-uclass.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c
index 637d420..7a57bce 100644
--- a/drivers/spi/spi-uclass.c
+++ b/drivers/spi/spi-uclass.c
@@ -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;
@@ -197,27 +188,6 @@ int spi_cs_info(struct udevice *bus, uint cs, struct spi_cs_info *info)
return -ENODEV;
}
-int spi_bind_device(struct udevice *bus, int cs, const char *drv_name,
- const char *dev_name, struct udevice **devp)
-{
- struct driver *drv;
- int ret;
-
- drv = lists_driver_lookup_name(drv_name);
- if (!drv) {
- printf("Cannot find driver '%s'\n", drv_name);
- return -ENOENT;
- }
- ret = device_bind(bus, drv, dev_name, NULL, -1, devp);
- if (ret) {
- printf("Cannot create device named '%s' (err=%d)\n",
- dev_name, ret);
- return ret;
- }
-
- return 0;
-}
-
int spi_find_bus_and_cs(int busnum, int cs, struct udevice **busp,
struct udevice **devp)
{
@@ -264,7 +234,7 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
if (ret == -ENODEV && drv_name) {
debug("%s: Binding new device '%s', busnum=%d, cs=%d, driver=%s\n",
__func__, dev_name, busnum, cs, drv_name);
- ret = spi_bind_device(bus, cs, drv_name, dev_name, &dev);
+ ret = device_bind_driver(bus, drv_name, dev_name, &dev);
if (ret)
return ret;
created = true;