[PATCH 2/2] mtd/plat-ram: use resource_size()

Wolfram Sang w.sang at pengutronix.de
Fri Jul 17 11:47:37 EDT 2009


Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
---
 drivers/mtd/maps/plat-ram.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index 49c9ece..dafb919 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -175,7 +175,7 @@ static int platram_probe(struct platform_device *pdev)
 	/* setup map parameters */
 
 	info->map.phys = res->start;
-	info->map.size = (res->end - res->start) + 1;
+	info->map.size = resource_size(res);
 	info->map.name = pdata->mapname != NULL ?
 			(char *)pdata->mapname : (char *)pdev->name;
 	info->map.bankwidth = pdata->bankwidth;
-- 
1.6.3.1




More information about the linux-mtd mailing list