linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, Alessandro Zummo <a.zummo@towertech.it>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: rv8803: Check return value of rv8803_write_reg
Date: Fri, 28 Dec 2018 01:43:05 +0100	[thread overview]
Message-ID: <20181228004305.GW2188@piout.net> (raw)
In-Reply-To: <20181227202856.27408-1-pakki001@umn.edu>

On 27/12/2018 14:28:55-0600, Aditya Pakki wrote:
> In rv8803_handle_irq, rv8803_write_reg can return a failed return
> value when attempting to write to the bus. The fix checks the output
> and throws a dev_warn notifying of the failure.
> 

Is there any point in doing that as the error will self correct later
anyway?

I really doubt there is any user reading the logs on the systems with an
rv8803 and there is no user action needed anyway.

> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>  drivers/rtc/rtc-rv8803.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
> index 450a0b831a2d..5a19d5ecbf57 100644
> --- a/drivers/rtc/rtc-rv8803.c
> +++ b/drivers/rtc/rtc-rv8803.c
> @@ -180,8 +180,13 @@ static irqreturn_t rv8803_handle_irq(int irq, void *dev_id)
>  
>  	if (events) {
>  		rtc_update_irq(rv8803->rtc, 1, events);
> -		rv8803_write_reg(client, RV8803_FLAG, flags);
> -		rv8803_write_reg(rv8803->client, RV8803_CTRL, rv8803->ctrl);
> +		if (rv8803_write_reg(client, RV8803_FLAG, flags))
> +			dev_warn(&client->dev, "Failed to write RV8803 reg.\n");
> +
> +		if (rv8803_write_reg(rv8803->client, RV8803_CTRL,
> +					rv8803->ctrl))
> +			dev_warn(&rv8803->client->dev,
> +				"Failed to write RV8803_CTRL reg.\n");
>  	}
>  
>  	mutex_unlock(&rv8803->flags_lock);
> -- 
> 2.17.1
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      parent reply	other threads:[~2018-12-28  0:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-27 20:28 [PATCH] rtc: rv8803: Check return value of rv8803_write_reg Aditya Pakki
2018-12-27 22:31 ` Heiner Kallweit
     [not found]   ` <CAK8KejrntOUb7Q2MrPR6mYDKyHKc=pzO5hOYv=ZfLaP_xg0Zsw@mail.gmail.com>
2018-12-27 23:43     ` Heiner Kallweit
2018-12-28  0:46     ` Alexandre Belloni
2018-12-28  0:43 ` Alexandre Belloni [this message]

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=20181228004305.GW2188@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /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).