]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: atcrtc100: Fix signedness bug in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 18 Nov 2025 10:48:56 +0000 (13:48 +0300)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 8 Dec 2025 21:59:58 +0000 (22:59 +0100)
The "atcrtc_dev->alarm_irq" variable is an unsigned int but it needs to
be signed for the error handling to work.  Use the "ret" variable
instead.

Fixes: 7adca706fe16 ("rtc: atcrtc100: Add ATCRTC100 RTC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aRxPGBEX8hbY6sjV@stanley.mountain
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-atcrtc100.c

index 51933ae1a2faecb38d5789944b4d99205eb7b267..9808fc2c5a492a11263134514e09f8a37e1f91fd 100644 (file)
@@ -296,10 +296,12 @@ static int atcrtc_probe(struct platform_device *pdev)
                                     "Failed to initialize RTC: unsupported hardware ID 0x%x\n",
                                     rtc_id);
 
-       atcrtc_dev->alarm_irq = platform_get_irq(pdev, 1);
-       if (atcrtc_dev->alarm_irq < 0)
-               return dev_err_probe(&pdev->dev, atcrtc_dev->alarm_irq,
+       ret = platform_get_irq(pdev, 1);
+       if (ret < 0)
+               return dev_err_probe(&pdev->dev, ret,
                                     "Failed to get IRQ for alarm\n");
+       atcrtc_dev->alarm_irq = ret;
+
        ret = devm_request_irq(&pdev->dev,
                               atcrtc_dev->alarm_irq,
                               atcrtc_alarm_isr,