All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] mtd: denali: fix error handling for devm_ioremap_nocache()
@ 2013-05-03  4:37 Xi Wang
  2013-05-29 12:42 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Xi Wang @ 2013-05-03  4:37 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Woodhouse, Xi Wang, Artem Bityutskiy

It is incorrect to use `!res' for error handling since `res' must be
non-null.  Use the return value `ptr' instead.

Signed-off-by: Xi Wang <xi.wang@gmail.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;
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-29 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03  4:37 [PATCH RESEND] mtd: denali: fix error handling for devm_ioremap_nocache() Xi Wang
2013-05-29 12:42 ` Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.