[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7cbe1a54-176d-43cc-aec9-faadc4a3c72e@web.de>
Date: Sun, 27 Jul 2025 18:42:30 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>,
linux-rtc@...r.kernel.org, Salah Triki <salah.triki@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rtc: twl: Check return value of platform_get_irq()
…
> > +++ b/drivers/rtc/rtc-twl.c
> > @@ -224,8 +224,11 @@ static int twl_rtc_alarm_irq_enable(struct device *dev, unsigned enabled)
> > {
> > struct platform_device *pdev = to_platform_device(dev);
> > struct twl_rtc *twl_rtc = dev_get_drvdata(dev);
> > - int irq = platform_get_irq(pdev, 0);
> > - int ret;
> > + int irq, ret;
> > +
> > + irq = platform_get_irq(pdev, 0);
> > + if (irq < 0)
> > + return irq;
>
> It won't ever fail because we know it already succeeded earlier.
An execution failure would be strange at this place after a successful function call
within twl_rtc_probe(), wouldn't it?
https://elixir.bootlin.com/linux/v6.16-rc7/source/drivers/rtc/rtc-twl.c#L504-L519
Regards,
Markus
Powered by blists - more mailing lists