Re: [PATCH] w1: omap-hdq: fix error return code in omap_hdq_probe()

From: Gustavo A. R. Silva
Date: Mon Jul 10 2017 - 15:35:17 EST


Hi Evgeniy,

Quoting Evgeniy Polyakov <zbr@xxxxxxxxxxx>:

Hi Gustavo, Greg

01.07.2017, 01:44, "Gustavo A. R. Silva" <garsilva@xxxxxxxxxxxxxx>:
platform_get_irq() returns an error code, but the omap_hdq
driver ignores it and always returns -ENXIO. This is not correct,
and prevents -EPROBE_DEFER from being propagated properly.
Notice that platform_get_irq() no longer returns 0 on error.

Print error message and propagate the return value of
platform_get_irq on failure.

Signed-off-by: Gustavo A. R. Silva <garsilva@xxxxxxxxxxxxxx>

Looks good to me, thank you.


Glad to help. :)

Greg, please pull it into the tree.
Acked-by: Evgeniy Polyakov <zbr@xxxxxxxxxxx>

---
Âdrivers/w1/masters/omap_hdq.c | 3 ++-
Â1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 3612542..83fc9aa 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -704,7 +704,8 @@ static int omap_hdq_probe(struct platform_device *pdev)

ÂÂÂÂÂÂÂÂÂirq = platform_get_irq(pdev, 0);
ÂÂÂÂÂÂÂÂÂif (irq < 0) {
- ret = -ENXIO;
+ dev_dbg(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+ ret = irq;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂgoto err_irq;
ÂÂÂÂÂÂÂÂÂ}

--
2.5.0
--
Gustavo A. R. Silva