mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] serial: stm32: suppress -EPROBE_DEFER messages using dev_err_probe
@ 2024-06-11  8:27 Ahmad Fatoum
  2024-06-13  7:06 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-06-11  8:27 UTC (permalink / raw)
  To: barebox; +Cc: Sven Püschel, Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-13  7:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-11  8:27 [PATCH master] serial: stm32: suppress -EPROBE_DEFER messages using dev_err_probe Ahmad Fatoum
2024-06-13  7:06 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox