[PATCH] ipmi: si: Handle errors from optional IRQ lookup

[email protected]
Newsgroups org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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")
Signed-off-by: bui duc phuc <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.