Skip to contentSkip to conversation

ipmi: si: Handle errors from optional IRQ lookup

PATCH In review [email protected] 2 participants 2 messages Aug 17 IPMI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipmi: si: Handle errors from optional IRQ lookup

From: bui duc phuc <[email protected]>

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")
---
 drivers/char/ipmi/ipmi_si_platform.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/char/ipmi/ipmi_si_platform.c +2 -0
index bdc481ce1302..04b3e205470f 100644
@@ -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
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 9 lines · On Mon, Aug 17, 2026 at 05:51:50PM +0700, [email protected] wrote:

From: bui duc phuc <[email protected]>

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.

The driver works without interrupts, and there may be cases where -EINVAL or -EPROBE_DEFER gets returned due to invalid configuration. This will break those systems.

So no.

-corey

Quoted 23 lines
Fixes 39851b7e580a ("ipmi: si: Use platform_get_irq_optional() to retrieve interrupt")
---
 drivers/char/ipmi/ipmi_si_platform.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/char/ipmi/ipmi_si_platform.c +2 -0
index bdc481ce1302..04b3e205470f 100644
@@ -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
Signature · 1 line
2.43.0