Browse Source

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@linaro.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Sachin Kamat 12 years ago
parent
commit
6c67050ab1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/mtd/nand/denali_dt.c

+ 1 - 1
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;