rtc: atcrtc100: Fix signedness bug in probe()

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: 7adca706fe ("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>
This commit is contained in:
Dan Carpenter 2025-11-18 13:48:56 +03:00 committed by Alexandre Belloni
parent f07640f9fb
commit 159a740c76
1 changed files with 5 additions and 3 deletions

View 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,