mtd: denali_dt: Change return value to fix smatch warning

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Apr 5 09:59:02 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2f2ff14c2760cd1db5dd05afddae9a5d9709047a
Commit:     2f2ff14c2760cd1db5dd05afddae9a5d9709047a
Parent:     82fc812ca458a98767b659171a43244dc1ddaf82
Author:     Sachin Kamat <sachin.kamat at linaro.org>
AuthorDate: Mon Mar 18 15:11:13 2013 +0530
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Apr 5 14:04:20 2013 +0100

    mtd: denali_dt: Change return value to fix smatch warning
    
    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 at linaro.org>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/denali_dt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);



More information about the linux-mtd-cvs mailing list