From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Dan Williams <dan.j.williams@intel.com>,
Vinod Koul <vinod.koul@intel.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] dmaengine: zx: add check on platform_get_irq return value
Date: Fri, 30 Jun 2017 02:55:03 -0500 [thread overview]
Message-ID: <20170630075502.GA27661@embeddedgus> (raw)
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
reply other threads:[~2017-06-30 7:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170630075502.GA27661@embeddedgus \
--to=garsilva@embeddedor.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox