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>
This commit is contained in:
Sachin Kamat 2013-03-18 15:11:11 +05:30 committed by David Woodhouse
parent 837a6ba4f3
commit 6c67050ab1
1 changed files with 1 additions and 1 deletions

View File

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