Patchwork [3/4] mtd: denali_dt: Change return value to fix smatch warning

login
register
mail settings
Submitter Sachin Kamat
Date March 18, 2013, 9:41 a.m.
Message ID <1363599674-26933-3-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/228429/
State New
Headers show

Comments

Sachin Kamat - March 18, 2013, 9:41 a.m.
platform_get_irq() also returns -ENXIO upon failure.
Use it instead of hardcoded return type.

Fixes the following smatch warning:
drivers/mtd/nand/denali_dt.c:93 denali_dt_probe() info:
why not propagate 'denali->irq' from platform_get_irq() instead of (-6)?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mtd/nand/denali_dt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index eb68979..067a505 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -90,7 +90,7 @@  static int denali_dt_probe(struct platform_device *ofdev)
 	denali->irq = platform_get_irq(ofdev, 0);
 	if (denali->irq < 0) {
 		dev_err(&ofdev->dev, "no irq defined\n");
-		return -ENXIO;
+		return denali->irq;
 	}
 
 	denali->flash_reg = request_and_map(&ofdev->dev, denali_reg);