From: Corey Minyard <corey@minyard.net>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-kernel@vger.kernel.org,
"moderated list:IPMI SUBSYSTEM"
<openipmi-developer@lists.sourceforge.net>
Subject: Re: [PATCH] ipmi: si: Use platform_get_irq() to retrieve interrupt
Date: Wed, 3 Jun 2026 18:17:34 -0500 [thread overview]
Message-ID: <aiC2Dj-Mes69Ltf2@mail.minyard.net> (raw)
In-Reply-To: <CAKxU2N-iq7B9pjtJ6pjZY6qQz4hkwKNhHgEv3uifV9zHev2SFA@mail.gmail.com>
On Wed, Jun 03, 2026 at 04:05:54PM -0700, Rosen Penev wrote:
> On Wed, Jun 3, 2026 at 3:57 PM Corey Minyard <corey@minyard.net> wrote:
> >
> > On Wed, Jun 03, 2026 at 05:53:56PM -0500, Corey Minyard wrote:
> > > On Wed, Jun 03, 2026 at 12:25:11PM -0700, Rosen Penev wrote:
> > > > Use platform_get_irq() to retrieve the interrupt resource instead of
> > > > directly parsing and mapping the OF node via irq_of_parse_and_map().
> > > > This is the standard pattern for platform devices.
> > > > irq_of_parse_and_map() requires ire_dispose_mapping(), which is missing.
> > > >
> > > > Assisted-by: Antigravity:Gemini-3.5-Flash
> > > > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > > > ---
> > > > drivers/char/ipmi/ipmi_si_platform.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
> > > > index fb6e359ae494..e10b5d8af092 100644
> > > > --- a/drivers/char/ipmi/ipmi_si_platform.c
> > > > +++ b/drivers/char/ipmi/ipmi_si_platform.c
> > > > @@ -276,7 +276,7 @@ static int of_ipmi_probe(struct platform_device *pdev)
> > > > io.regspacing = regspacing ? be32_to_cpup(regspacing) : DEFAULT_REGSPACING;
> > > > io.regshift = regshift ? be32_to_cpup(regshift) : 0;
> > > >
> > > > - io.irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
> > > > + io.irq = platform_get_irq(pdev, 0);
> > >
> > > This should be something like:
> > >
> > > io.irq = platform_get_irq_optional(pdev, 0);
> > > if (io.irq > 0)
> > > io.irq_setup = ipmi_std_irq_setup;
> > > else
> > > io.irq = 0;
> > >
> > > right?
> >
> > Oops, cut and paste error, try:
> >
> > io.irq = platform_get_irq_optional(pdev, 0);
> > if (io.irq < 0)
> > io.irq = 0;
> I don't think that if is appropriate.
Can platform_get_irq[_optional]() return < 0? The driver still has to
work even if there is no interrupt specified.
-corey
> >
> > This just disables the interrupt if it can't get it.
> >
> > >
> > > -corey
> > >
> > > > io.dev = &pdev->dev;
> > > >
> > > > dev_dbg(&pdev->dev, "addr 0x%lx regsize %d spacing %d irq %d\n",
> > > > --
> > > > 2.54.0
> > > >
next prev parent reply other threads:[~2026-06-03 23:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 19:25 [PATCH] ipmi: si: Use platform_get_irq() to retrieve interrupt Rosen Penev
2026-06-03 22:53 ` Corey Minyard
2026-06-03 22:57 ` Corey Minyard
2026-06-03 23:05 ` Rosen Penev
2026-06-03 23:17 ` Corey Minyard [this message]
2026-06-03 23:18 ` Rosen Penev
2026-06-04 11:17 ` Corey Minyard
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=aiC2Dj-Mes69Ltf2@mail.minyard.net \
--to=corey@minyard.net \
--cc=linux-kernel@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=rosenp@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