mtd: denali_dt: Fix incorrect error check

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


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=6c67050ab108bcce2576fa1d7a0557eb0376520a
Commit:     6c67050ab108bcce2576fa1d7a0557eb0376520a
Parent:     837a6ba4f3b6d23026674e6af6b6849a4634fff9
Author:     Sachin Kamat <sachin.kamat at linaro.org>
AuthorDate: Mon Mar 18 15:11:11 2013 +0530
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Apr 5 14:03:53 2013 +0100

    mtd: denali_dt: Fix incorrect error check
    
    The return value of devm_ioremap_nocache should be checked here instead
    of res.
    
    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 546f8cb..02988b0 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -42,7 +42,7 @@ static void __iomem *request_and_map(struct device *dev,
 	}
 
 	ptr = devm_ioremap_nocache(dev, res->start, resource_size(res));
-	if (!res)
+	if (!ptr)
 		dev_err(dev, "ioremap_nocache of %s failed!", res->name);
 
 	return ptr;



More information about the linux-mtd-cvs mailing list