]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: rx8025: fix incorrect register reference
authorYuta Hayama <hayama@lineo.co.jp>
Wed, 15 Oct 2025 03:07:05 +0000 (12:07 +0900)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 8 Nov 2025 19:56:12 +0000 (20:56 +0100)
This code is intended to operate on the CTRL1 register, but ctrl[1] is
actually CTRL2. Correctly, ctrl[0] is CTRL1.

Signed-off-by: Yuta Hayama <hayama@lineo.co.jp>
Fixes: 71af91565052 ("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: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-rx8025.c

index aabe62c283a150f18810545a05827f54b8ed468f..7e9f7cb90c288758405e82e3dcb3c72486f515e4 100644 (file)
@@ -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;