[PATCH 2/8] driver: Don't throw an error on probes that didn't find the device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As the name suggests, determining that a device doesn't match is a valid
thing for probe to do. Unlike Linux, we throw an error in that case.
This will becomes annoying if we start probing virtio-mmio devices,
because Qemu registers a bunch and only assigns functions on demand.
Thus don't print an error message for ENXIO and ENODEV like Linux does.

Signed-off-by: Ahmad Fatoum <ahmad@xxxxxx>
---
 drivers/base/driver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 6763bbc6f512..f60533c59eb1 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -102,7 +102,10 @@ int device_probe(struct device_d *dev)
 	list_del(&dev->active);
 	INIT_LIST_HEAD(&dev->active);
 
-	dev_err(dev, "probe failed: %s\n", strerror(-ret));
+	if (ret == -ENODEV || ret == -ENXIO)
+		dev_dbg(dev, "probe failed: %s\n", strerror(-ret));
+	else
+		dev_err(dev, "probe failed: %s\n", strerror(-ret));
 
 	return ret;
 }
-- 
2.30.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux