* [PATCH] dmaengine: zx: add check on platform_get_irq return value
@ 2017-06-30 7:55 Gustavo A. R. Silva
0 siblings, 0 replies; only message in thread
From: Gustavo A. R. Silva @ 2017-06-30 7:55 UTC (permalink / raw)
To: Dan Williams, Vinod Koul; +Cc: dmaengine, linux-kernel, Gustavo A. R. Silva
Check return value from call to platform_get_irq(),
so in case of failure print error message and propagate
the return value.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/dma/zx_dma.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c
index 2bb6953..26196de 100644
--- a/drivers/dma/zx_dma.c
+++ b/drivers/dma/zx_dma.c
@@ -786,6 +786,11 @@ static int zx_dma_probe(struct platform_device *op)
}
d->irq = platform_get_irq(op, 0);
+ if (d->irq < 0) {
+ dev_err(&op->dev, "failed to get IRQ: %d\n", d->irq);
+ return d->irq;
+ }
+
ret = devm_request_irq(&op->dev, d->irq, zx_dma_int_handler,
0, DRIVER_NAME, d);
if (ret)
--
2.5.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-30 7:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-30 7:55 [PATCH] dmaengine: zx: add check on platform_get_irq return value Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox