public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sata_rcar: fix error return code in sata_rcar_probe()
@ 2017-06-30  5:22 Gustavo A. R. Silva
  2017-06-30  9:42 ` Sergei Shtylyov
  0 siblings, 1 reply; 13+ messages in thread
From: Gustavo A. R. Silva @ 2017-06-30  5:22 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, linux-kernel, Gustavo A. R. Silva

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

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

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index ee98447..c936b2a 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -872,8 +872,10 @@ static int sata_rcar_probe(struct platform_device *pdev)
 	int ret = 0;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
-		return -EINVAL;
+	if (irq < 0) {
+		dev_err(&pdev->dev, "failed to get IRQ\n");
+		return irq;
+	}
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(struct sata_rcar_priv),
 			   GFP_KERNEL);
-- 
2.5.0

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

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

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30  5:22 [PATCH] sata_rcar: fix error return code in sata_rcar_probe() Gustavo A. R. Silva
2017-06-30  9:42 ` Sergei Shtylyov
2017-06-30 12:01   ` Tejun Heo
2017-06-30 19:36     ` Gustavo A. R. Silva
2017-06-30 19:42       ` Sergei Shtylyov
2017-06-30 19:54         ` Gustavo A. R. Silva
2017-06-30 19:46       ` Gustavo A. R. Silva
2017-06-30 20:03         ` Sergei Shtylyov
2017-06-30 20:34           ` Gustavo A. R. Silva
2017-06-30 21:08             ` [PATCH v2] " Gustavo A. R. Silva
2017-06-30 21:09               ` Sergei Shtylyov
2017-06-30 21:11                 ` Gustavo A. R. Silva
2017-06-30 12:35   ` [PATCH] " Sergei Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox