Skip to contentSkip to conversation

w1: omap-hdq: fix error return code in omap_hdq_probe()

PATCH In review Gustavo A. R. Silva 1 participant 2 messages Jun 30, 2017 – Jul 10, 2017 1 message not in the archive W1 dallas's 1-wire bus

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 w1: omap-hdq: fix error return code in omap_hdq_probe()

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.

---
 drivers/w1/masters/omap_hdq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/w1/masters/omap_hdq.c +2 -1
index 3612542..83fc9aa 100644
@@ -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;
 	}
 
Signature · 1 line
2.5.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Evgeniy,

Quoting Evgeniy Polyakov <[email protected]>:

Quoted 8 lines

Hi Gustavo, Greg

01.07.2017, 01:44, "Gustavo A. R. Silva" <[email protected]>:

Quoted 5 lines

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.

Quoted 7 lines
Quoted 4 lines

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

Looks good to me, thank you.

Glad to help. :)

Quoted 21 lines

Greg, please pull it into the tree.

Quoted 18 lines

---
 drivers/w1/masters/omap_hdq.c | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/w1/masters/omap_hdq.c +2 -1
index 3612542..83fc9aa 100644
@@ -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;
          }
 
Quoted 2 lines
Quoted 2 lines

--
2.5.0

--
Gustavo A. R. Silva