aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rv8803.c
diff options
context:
space:
mode:
authorDominique Martinet <dominique.martinet@atmark-techno.com>2021-11-01 10:33:59 +0900
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2021-11-10 00:44:08 +0100
commit03a86cda4123084c7969387e7e0b69f23c2f8acf (patch)
treee5416ffa4b0704c73796ea14ba778106b3e651a6 /drivers/rtc/rtc-rv8803.c
parenta5feda3b361e11b291786d5c4ff86d4b9a55498f (diff)
downloadlinux-03a86cda4123084c7969387e7e0b69f23c2f8acf.tar.gz
rtc: rv8803: fix writing back ctrl in flag register
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> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20211101013400.325855-1-dominique.martinet@atmark-techno.com
Diffstat (limited to 'drivers/rtc/rtc-rv8803.c')
-rw-r--r--drivers/rtc/rtc-rv8803.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
index 72adef5a5ebe8..0d5ed38bf60cc 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;