spi: Add a debug() on bind failure
authorSimon Glass <sjg@chromium.org>
Sun, 13 Nov 2016 21:22:05 +0000 (14:22 -0700)
committerSimon Glass <sjg@chromium.org>
Sat, 26 Nov 2016 00:59:30 +0000 (17:59 -0700)
This is an uncommon error but we may as well have a debug() message when
it happens.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/spi/spi-uclass.c

index 26eada2dd2a305f2d78b18b6797236b5f8a5d62f..f59a70173c41ace0b05c6ae805657f26c11bb496 100644 (file)
@@ -297,8 +297,11 @@ int spi_get_bus_and_cs(int busnum, int cs, int speed, int mode,
                debug("%s: Binding new device '%s', busnum=%d, cs=%d, driver=%s\n",
                      __func__, dev_name, busnum, cs, drv_name);
                ret = device_bind_driver(bus, drv_name, dev_name, &dev);
-               if (ret)
+               if (ret) {
+                       debug("%s: Unable to bind driver (ret=%d)\n", __func__,
+                             ret);
                        return ret;
+               }
                plat = dev_get_parent_platdata(dev);
                plat->cs = cs;
                plat->max_hz = speed;