The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Corey Minyard <corey@minyard.net>, Rosen Penev <rosenp@gmail.com>,
	openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH] ipmi: si: Handle errors from optional IRQ lookup
Date: Mon, 17 Aug 2026 17:51:50 +0700	[thread overview]
Message-ID: <20260817105150.63310-1-phucduc.bui@gmail.com> (raw)

From: bui duc phuc <phucduc.bui@gmail.com>

platform_get_irq_optional() returns a positive IRQ number on success or
a negative error code on failure. For an optional IRQ, -ENXIO indicates
that no optional IRQ is available. Other errors, such as -EPROBE_DEFER
and -EINVAL, should be propagated so that the caller can handle them
appropriately.

Propagate negative errors other than -ENXIO.

Fixes: 39851b7e580a ("ipmi: si: Use platform_get_irq_optional() to retrieve interrupt")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/char/ipmi/ipmi_si_platform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
index bdc481ce1302..04b3e205470f 100644
--- a/drivers/char/ipmi/ipmi_si_platform.c
+++ b/drivers/char/ipmi/ipmi_si_platform.c
@@ -198,6 +198,8 @@ static int platform_ipmi_probe(struct platform_device *pdev)
 		io.slave_addr = slave_addr;
 
 	io.irq = platform_get_irq_optional(pdev, 0);
+	if (io.irq < 0 && io.irq != -ENXIO)
+		return io.irq;
 	if (io.irq > 0)
 		io.irq_setup = ipmi_std_irq_setup;
 	else
-- 
2.43.0


             reply	other threads:[~2026-08-17 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 10:51 phucduc.bui [this message]
2026-08-17 11:30 ` [PATCH] ipmi: si: Handle errors from optional IRQ lookup 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=20260817105150.63310-1-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=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