rtc: rx8025: fix rx8025_init_client()
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Tue, 4 Aug 2015 08:46:22 +0000 (10:46 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 5 Sep 2015 11:19:12 +0000 (13:19 +0200)
rx8025_init_client is modifying ctrl[0] and writing it to RX8025_REG_CTRL2
but ctrl[0] is actually RX8025_REG_CTRL1.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-rx8025.c

index ab5fb4fe2a835ad6056fd954de9e04550e20f707..22ce08d6e807706749b0624889ff7a0d04c007b9 100644 (file)
@@ -263,7 +263,7 @@ static int rx8025_init_client(struct i2c_client *client)
                need_clear = 1;
 
        if (need_clear) {
-               ctrl2 = ctrl[0];
+               ctrl2 = ctrl[1];
                ctrl2 &= ~(RX8025_BIT_CTRL2_PON | RX8025_BIT_CTRL2_VDET |
                           RX8025_BIT_CTRL2_CTFG | RX8025_BIT_CTRL2_WAFG |
                           RX8025_BIT_CTRL2_DAFG);