From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Hugo Villeneuve <hugo@hugovil.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
Hugo Villeneuve <hvilleneuve@dimonoff.com>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: pcf2127: add error message if writing to CLKOUT register fails
Date: Wed, 19 Jan 2022 18:37:40 +0100 [thread overview]
Message-ID: <YehMZC4vduvSH5HA@piout.net> (raw)
In-Reply-To: <20220119172740.1856302-1-hugo@hugovil.com>
On 19/01/2022 12:27:39-0500, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
>
> If writing to CLKOUT register fails, the probe operation will be aborted
> without a meaningful error message.
>
The current trend is to remove debug messages, please do not add more :)
> 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
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2022-01-19 17:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=YehMZC4vduvSH5HA@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=hugo@hugovil.com \
--cc=hvilleneuve@dimonoff.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).