mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: rcz@pengutronix.de
Subject: [PATCH 2/8] driver: Don't throw an error on probes that didn't find the device
Date: Mon, 22 Feb 2021 08:05:58 +0100	[thread overview]
Message-ID: <20210222070605.589180-3-ahmad@a3f.at> (raw)
In-Reply-To: <20210222070605.589180-1-ahmad@a3f.at>

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>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2021-02-22  7:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22  7:05 [PATCH 0/8] drivers: add VirtIO console, block device support Ahmad Fatoum
2021-02-22  7:05 ` [PATCH 1/8] kbuild: add include/uapi to path Ahmad Fatoum
2021-02-22  7:05 ` Ahmad Fatoum [this message]
2021-02-22  7:05 ` [PATCH 3/8] drivers: add support for memory-mapped VirtIO paravirtualization Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 4/8] hw_random: add VirtIO RNG driver Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 5/8] serial: add basic VirtIO console driver Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 6/8] block: add VirtIO block device driver Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 7/8] ARM: vexpress: config: update for VirtIO support Ahmad Fatoum
2021-02-22  7:06 ` [PATCH 8/8] Documentation: add Documentation on VirtIO for barebox Ahmad Fatoum
2021-02-22  7:15   ` [PATCH] fixup! " Ahmad Fatoum
2021-02-22  8:39   ` [PATCH] fixup! " Ahmad Fatoum
2021-02-22  9:53 ` [PATCH 0/8] drivers: add VirtIO console, block device support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210222070605.589180-3-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    --cc=rcz@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox