From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Dominique Martinet <dominique.martinet@atmark-techno.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] rtc-rv8803: fix writing back ctrl in flag register
Date: Mon, 8 Nov 2021 09:42:53 +0100 [thread overview]
Message-ID: <YYjjDW6WhBJqUGJD@piout.net> (raw)
In-Reply-To: <YYiWq564QzQgTsqV@atmark-techno.com>
On 08/11/2021 12:16:59+0900, Dominique Martinet wrote:
> Hi Alexandre, Alessandro,
>
> the other patch was proved to be unneeded, but this one is still a valid
> fix as far as I can understand the code (reusing RV8803_CTRL value to
> write into RV8803_FLAG does not look correct)
>
> (I'm also convinced either mostly work because the original values are
> usually close enough, but that's not a reason to keep using the wrong
> one)
>
>
> Would you have time to take a look?
I did check with the initial review and I'm going to apply it, I just
didn't have the time to do that yet.
>
>
> Thanks!
>
> Dominique Martinet wrote on Mon, Nov 01, 2021 at 10:33:59AM +0900:
> > ctrl is set from read_regs(..FLAG, 2, ctrl), so ctrl[0] is FLAG
> > and ctrl[1] is the CTRL register.
> > Use ctrl[0] to write back to the FLAG register as appropriate.
> >
> > Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> > ---
> > drivers/rtc/rtc-rv8803.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
> > index 72adef5a5ebe..0d5ed38bf60c 100644
> > --- a/drivers/rtc/rtc-rv8803.c
> > +++ b/drivers/rtc/rtc-rv8803.c
> > @@ -340,8 +340,8 @@ static int rv8803_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
> > }
> > }
> >
> > - ctrl[1] &= ~RV8803_FLAG_AF;
> > - err = rv8803_write_reg(rv8803->client, RV8803_FLAG, ctrl[1]);
> > + ctrl[0] &= ~RV8803_FLAG_AF;
> > + err = rv8803_write_reg(rv8803->client, RV8803_FLAG, ctrl[0]);
> > mutex_unlock(&rv8803->flags_lock);
> > if (err)
> > return err;
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2021-11-08 8:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 1:33 [PATCH 1/2] rtc-rv8803: fix writing back ctrl in flag register Dominique Martinet
2021-11-01 1:34 ` [PATCH 2/2] rv8803: add irq-gpio optional dts attribute Dominique Martinet
2021-11-01 12:53 ` Rob Herring
2021-11-01 22:48 ` Alexandre Belloni
2021-11-01 23:40 ` Dominique Martinet
2021-11-02 8:40 ` Alexandre Belloni
2021-11-08 3:16 ` [PATCH 1/2] rtc-rv8803: fix writing back ctrl in flag register Dominique Martinet
2021-11-08 8:42 ` Alexandre Belloni [this message]
2021-11-08 23:41 ` Dominique Martinet
2021-11-09 23:44 ` 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=YYjjDW6WhBJqUGJD@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=dominique.martinet@atmark-techno.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).