linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] rtc-rv8803: fix writing back ctrl in flag register
@ 2021-11-01  1:33 Dominique Martinet
  2021-11-01  1:34 ` [PATCH 2/2] rv8803: add irq-gpio optional dts attribute Dominique Martinet
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dominique Martinet @ 2021-11-01  1:33 UTC (permalink / raw)
  To: Alexandre Belloni, Alessandro Zummo
  Cc: linux-rtc, linux-kernel, Marek Vasut, Rob Herring, Dominique Martinet

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>
---

This probably works in practice because the two registers are pretty close,
but might as well fix it and use the correct register.

 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;
-- 
2.30.2


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

end of thread, other threads:[~2021-11-09 23:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-11-08 23:41     ` Dominique Martinet
2021-11-09 23:44 ` Alexandre Belloni

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).