Commit 03a86cda authored by Dominique Martinet's avatar Dominique Martinet Committed by Alexandre Belloni
Browse files

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: default avatarDominique Martinet <dominique.martinet@atmark-techno.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211101013400.325855-1-dominique.martinet@atmark-techno.com
parent a5feda3b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;