[PATCH 1/5] driver: print error message when probe fails
Sascha Hauer
s.hauer at pengutronix.de
Sun Oct 7 07:39:47 EDT 2012
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/base/driver.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 6c8fd05..7bb3ab4 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -77,6 +77,8 @@ int get_free_deviceid(const char *name_template)
static int match(struct driver_d *drv, struct device_d *dev)
{
+ int ret;
+
if (dev->driver)
return -1;
@@ -84,8 +86,11 @@ static int match(struct driver_d *drv, struct device_d *dev)
if (dev->bus->match(dev, drv))
goto err_out;
- if (dev->bus->probe(dev))
+ ret = dev->bus->probe(dev);
+ if (ret) {
+ dev_err(dev, "probe failed: %s\n", strerror(-ret));
goto err_out;
+ }
list_add(&dev->active, &active);
--
1.7.10.4
More information about the barebox
mailing list