]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtc: renesas-rtca3: Check RADJ poll result during initial setup
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tue, 2 Jun 2026 19:25:56 +0000 (20:25 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 21 Jun 2026 23:59:16 +0000 (01:59 +0200)
In rtca3_initial_setup(), the driver clears the RTCA3_RADJ register and
waits for it to reach zero using readb_poll_timeout(). Check the return
value of readb_poll_timeout() and propagate the error if the poll fails.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> # on RZ/G3S
Link: https://patch.msgid.link/20260602192559.1791344-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-renesas-rtca3.c

index 2dc080d0eb6cda67b4aaa16b8686c6da0c22bfe1..af2a3878289e3ea29c14f46b334f651f4db426ef 100644 (file)
@@ -634,6 +634,8 @@ static int rtca3_initial_setup(struct clk *clk, struct rtca3_priv *priv)
        writeb(0, priv->base + RTCA3_RADJ);
        ret = readb_poll_timeout(priv->base + RTCA3_RADJ, tmp, !tmp, 10,
                                 RTCA3_DEFAULT_TIMEOUT_US);
+       if (ret)
+               return ret;
 
        /* Start the RTC and enable automatic time error adjustment. */
        mask = RTCA3_RCR2_START | RTCA3_RCR2_AADJE;