summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2021-02-22 08:05:58 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-02-22 10:24:00 +0100
commitc0f984b4dfe53c66fa15e18d89b5a7b122d541fd (patch)
tree7c258b09329c9ba8e9c21c66f5a9bb38fd7a1361
parent9e48729c073ae28a9b59c597011aabf11f3658bd (diff)
downloadbarebox-c0f984b4dfe53c66fa15e18d89b5a7b122d541fd.tar.gz
barebox-c0f984b4dfe53c66fa15e18d89b5a7b122d541fd.tar.xz
driver: Don't throw an error on probes that didn't find the device
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@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/base/driver.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 6763bbc6f5..f60533c59e 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;
}