mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rtc: pcf2127: add error message if writing to CLKOUT register fails
@ 2022-01-19 17:27 Hugo Villeneuve
  2022-01-19 17:37 ` Alexandre Belloni
  0 siblings, 1 reply; 6+ messages in thread
From: Hugo Villeneuve @ 2022-01-19 17:27 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: hugo, Hugo Villeneuve, linux-rtc, linux-kernel

From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

If writing to CLKOUT register fails, the probe operation will be aborted
without a meaningful error message.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 drivers/rtc/rtc-pcf2127.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c
index 3d1f57e54372..823abe2a7147 100644
--- a/drivers/rtc/rtc-pcf2127.c
+++ b/drivers/rtc/rtc-pcf2127.c
@@ -717,8 +717,10 @@ static int pcf2127_probe(struct device *dev, struct regmap *regmap,
 	if (!(val & PCF2127_BIT_CLKOUT_OTPR)) {
 		ret = regmap_set_bits(pcf2127->regmap, PCF2127_REG_CLKOUT,
 				      PCF2127_BIT_CLKOUT_OTPR);
-		if (ret < 0)
+		if (ret < 0) {
+			dev_err(dev, "writing to CLKOUT register failed\n");
 			return ret;
+		}
 
 		msleep(100);
 	}
-- 
2.30.2


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

end of thread, other threads:[~2022-01-21 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 17:27 [PATCH] rtc: pcf2127: add error message if writing to CLKOUT register fails Hugo Villeneuve
2022-01-19 17:37 ` Alexandre Belloni
2022-01-19 18:08   ` Hugo Villeneuve
2022-01-19 19:10     ` Alexandre Belloni
2022-01-20 23:35       ` Hugo Villeneuve
2022-01-21 17:06         ` Alexandre Belloni

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

Powered by JetHome