All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sata_highbank: fix error return code in ahci_highbank_probe()
@ 2017-06-30  5:03 Gustavo A. R. Silva
  2017-06-30 21:20 ` [PATCH v2] " Gustavo A. R. Silva
  2017-06-30 21:21 ` [PATCH] " Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30  5:03 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, linux-kernel, Gustavo A. R. Silva

Propagate the return value of platform_get_irq on failure.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
 drivers/ata/sata_highbank.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index aafb8cc..2fc451c 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -483,9 +483,9 @@ static int ahci_highbank_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	if (irq < 0) {
 		dev_err(dev, "no irq\n");
-		return -EINVAL;
+		return irq;
 	}
 
 	hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] sata_highbank: fix error return code in ahci_highbank_probe()
  2017-06-30  5:03 [PATCH] sata_highbank: fix error return code in ahci_highbank_probe() Gustavo A. R. Silva
@ 2017-06-30 21:20 ` Gustavo A. R. Silva
  2017-06-30 21:21 ` [PATCH] " Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 21:20 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, linux-kernel, Gustavo A. R. Silva

platform_get_irq() returns an error code, but the sata_highbank
driver ignores it and always returns -EINVAL. This is not correct,
and prevents -EPROBE_DEFER from being propagated properly.
Also, 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@embeddedor.com>
---
Changes in v2:
 Rewrite commit message. 

 drivers/ata/sata_highbank.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index aafb8cc..1419cf9 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -483,9 +483,9 @@ static int ahci_highbank_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
-		dev_err(dev, "no irq\n");
-		return -EINVAL;
+	if (irq < 0) {
+		dev_err(dev, "failed to get IRQ: %d\n", irq);
+		return irq;
 	}
 
 	hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] sata_highbank: fix error return code in ahci_highbank_probe()
  2017-06-30  5:03 [PATCH] sata_highbank: fix error return code in ahci_highbank_probe() Gustavo A. R. Silva
  2017-06-30 21:20 ` [PATCH v2] " Gustavo A. R. Silva
@ 2017-06-30 21:21 ` Sergei Shtylyov
  2017-06-30 21:24   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2017-06-30 21:21 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Tejun Heo; +Cc: linux-ide, linux-kernel

On 06/30/2017 08:03 AM, Gustavo A. R. Silva wrote:

> Propagate the return value of platform_get_irq on failure.

    Needs the same explanations as the sata_rcar patch.

> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
[...]

MBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sata_highbank: fix error return code in ahci_highbank_probe()
  2017-06-30 21:21 ` [PATCH] " Sergei Shtylyov
@ 2017-06-30 21:24   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30 21:24 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Tejun Heo, linux-ide, linux-kernel


Quoting Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>:

> On 06/30/2017 08:03 AM, Gustavo A. R. Silva wrote:
>
>> Propagate the return value of platform_get_irq on failure.
>
>    Needs the same explanations as the sata_rcar patch.
>

Yep, I already sent v2 a minute ago.

Thanks!
--
Gustavo A. R. Silva

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-30 21:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  5:03 [PATCH] sata_highbank: fix error return code in ahci_highbank_probe() Gustavo A. R. Silva
2017-06-30 21:20 ` [PATCH v2] " Gustavo A. R. Silva
2017-06-30 21:21 ` [PATCH] " Sergei Shtylyov
2017-06-30 21:24   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.