Commit 162f24cb authored by Yuta Hayama's avatar Yuta Hayama Committed by Alexandre Belloni
Browse files

rtc: rx8025: fix incorrect register reference



This code is intended to operate on the CTRL1 register, but ctrl[1] is
actually CTRL2. Correctly, ctrl[0] is CTRL1.

Signed-off-by: default avatarYuta Hayama <hayama@lineo.co.jp>
Fixes: 71af9156 ("rtc: rx8025: fix 12/24 hour mode detection on RX-8035")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/eae5f479-5d28-4a37-859d-d54794e7628c@lineo.co.jp


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 0d510778
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ static int rx8025_init_client(struct i2c_client *client)
			return hour_reg;
		rx8025->is_24 = (hour_reg & RX8035_BIT_HOUR_1224);
	} else {
		rx8025->is_24 = (ctrl[1] & RX8025_BIT_CTRL1_1224);
		rx8025->is_24 = (ctrl[0] & RX8025_BIT_CTRL1_1224);
	}
out:
	return err;