Patchwork Use resource_size() macro for Nomadik NAND driver

login
register
mail settings
Submitter Linus Walleij
Date Oct. 12, 2009, 8:49 a.m.
Message ID <1255337349-30567-1-git-send-email-linus.walleij@stericsson.com>
Download mbox | patch
Permalink /patch/35737/
State Accepted
Commit 4442241ef6ed4d53c13d1c4b18fd57918bb4c850
Headers show

Comments

Linus Walleij - Oct. 12, 2009, 8:49 a.m.
This makes a trivial fix for the Nomadik NAND driver to use the
resource_size() macro.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: Alessandro Rubini <rubini@unipv.it>
---
 drivers/mtd/nand/nomadik_nand.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index 7c302d5..ed966c0 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -104,21 +104,21 @@  static int nomadik_nand_probe(struct platform_device *pdev)
 		ret = -EIO;
 		goto err_unmap;
 	}
-	host->addr_va = ioremap(res->start, res->end - res->start + 1);
+	host->addr_va = ioremap(res->start, resource_size(res));
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_data");
 	if (!res) {
 		ret = -EIO;
 		goto err_unmap;
 	}
-	host->data_va = ioremap(res->start, res->end - res->start + 1);
+	host->data_va = ioremap(res->start, resource_size(res));
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd");
 	if (!res) {
 		ret = -EIO;
 		goto err_unmap;
 	}
-	host->cmd_va = ioremap(res->start, res->end - res->start + 1);
+	host->cmd_va = ioremap(res->start, resource_size(res));
 
 	if (!host->addr_va || !host->data_va || !host->cmd_va) {
 		ret = -ENOMEM;