mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: "Sven Püschel" <s.pueschel@pengutronix.de>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>
Subject: [PATCH master] serial: stm32: suppress -EPROBE_DEFER messages using dev_err_probe
Date: Tue, 11 Jun 2024 10:27:14 +0200	[thread overview]
Message-ID: <20240611082714.2963587-1-a.fatoum@pengutronix.de> (raw)

A return code of -EPROBE_DEFER is not necessarily an error as the clock
driver may indeed be probed later. Use dev_err_probe to silence the
error message in this situation and to store it for later use if the
probe is deferred permanently.

Co-developed-by: Sven Püschel <s.pueschel@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/serial/serial_stm32.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/serial_stm32.c b/drivers/serial/serial_stm32.c
index 3e18a2c152af..eebae6f6ee9e 100644
--- a/drivers/serial/serial_stm32.c
+++ b/drivers/serial/serial_stm32.c
@@ -167,14 +167,14 @@ static int stm32_serial_probe(struct device *dev)
 
 	stm32->clk = clk_get_for_console(dev, NULL);
 	if (IS_ERR(stm32->clk)) {
-		ret = PTR_ERR(stm32->clk);
-		dev_err(dev, "Failed to get UART clock %d\n", ret);
+		ret = dev_err_probe(dev, PTR_ERR(stm32->clk),
+				    "Failed to get UART clock\n");
 		goto io_release;
 	}
 
 	ret = clk_enable(stm32->clk);
 	if (ret) {
-		dev_err(dev, "Failed to enable UART clock %d\n", ret);
+		dev_err_probe(dev, ret, "Failed to enable UART clock\n");
 		goto io_release;
 	}
 
-- 
2.39.2




             reply	other threads:[~2024-06-11  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11  8:27 Ahmad Fatoum [this message]
2024-06-13  7:06 ` 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=20240611082714.2963587-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.pueschel@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