]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
rtc: rv8803: fix writing back ctrl in flag register
authorDominique Martinet <dominique.martinet@atmark-techno.com>
Mon, 1 Nov 2021 01:33:59 +0000 (10:33 +0900)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 9 Nov 2021 23:44:08 +0000 (00:44 +0100)
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
drivers/rtc/rtc-rv8803.c

index 72adef5a5ebe80b9a8ce1c8c09c1433f2da3de22..0d5ed38bf60ccef450259405ad2a3d022d4d50f7 100644 (file)
@@ -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;