diff mbox

[v2,2/2,media] coda: Propagate the correct error on devm_request_threaded_irq()

Message ID 1401907584-30218-2-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabio Estevam June 4, 2014, 6:46 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

If devm_request_threaded_irq() fails, we should better propagate the real error.

Also, print out the error code in the dev_err message.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
---
Changes since v1:
- None. Only rebased against latest tree

 drivers/media/platform/coda.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c
index 32b3b6d..661bbe6 100644
--- a/drivers/media/platform/coda.c
+++ b/drivers/media/platform/coda.c
@@ -3232,10 +3232,11 @@  static int coda_probe(struct platform_device *pdev)
 		return irq;
 	}
 
-	if (devm_request_threaded_irq(&pdev->dev, irq, NULL, coda_irq_handler,
-		IRQF_ONESHOT, dev_name(&pdev->dev), dev) < 0) {
-		dev_err(&pdev->dev, "failed to request irq\n");
-		return -ENOENT;
+	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, coda_irq_handler,
+			IRQF_ONESHOT, dev_name(&pdev->dev), dev);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "failed to request irq: %d\n", ret);
+		return ret;
 	}
 
 	/* Get IRAM pool from device tree or platform data */