Patchwork mtd: denali: fix error handling for devm_ioremap_nocache()

login
register
mail settings
Submitter Xi Wang
Date March 22, 2013, 4:42 a.m.
Message ID <1363927354-13125-1-git-send-email-xi.wang@gmail.com>
Download mbox | patch
Permalink /patch/229882/
State New
Headers show

Comments

Xi Wang - March 22, 2013, 4:42 a.m.
Use `ptr' rather than `res' to check the return value.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
---
 drivers/mtd/nand/denali_dt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

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;