linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-rtc@vger.kernel.org, Salah Triki <salah.triki@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rtc: twl: Check return value of platform_get_irq()
Date: Sun, 27 Jul 2025 18:42:30 +0200	[thread overview]
Message-ID: <7cbe1a54-176d-43cc-aec9-faadc4a3c72e@web.de> (raw)
In-Reply-To: <20250724073308430368ff@mail.local>

…
> > +++ 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

      reply	other threads:[~2025-07-27 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24  2:06 [PATCH] rtc: twl: Check return value of platform_get_irq() Salah Triki
2025-07-24  7:33 ` Alexandre Belloni
2025-07-27 16:42   ` Markus Elfring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7cbe1a54-176d-43cc-aec9-faadc4a3c72e@web.de \
    --to=markus.elfring@web.de \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=salah.triki@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).