Patchwork [1/4] mtd: denali_dt: Fix incorrect error check

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

Comments

Sachin Kamat - March 18, 2013, 9:41 a.m.
The return value of devm_ioremap_nocache should be checked here instead
of res.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Dinh Nguyen <dinguyen@altera.com>
---
This series is compile tested against linux-next tree (20130318).
---
 drivers/mtd/nand/denali_dt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - April 5, 2013, 12:04 p.m.
On Mon, 2013-03-18 at 15:11 +0530, Sachin Kamat wrote:
> The return value of devm_ioremap_nocache should be checked here instead
> of res.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

All look good, pushed the series to l2-mtd.git, thanks!

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;