From patchwork Mon Dec 14 21:59:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: drivers/mtd/nand/sh_flctl.c: use resource_size() Date: Mon, 14 Dec 2009 11:59:27 -0000 From: hartleys X-Patchwork-Id: 41152 Message-Id: To: "kernel list" , Cc: shimoda.yoshihiro@renesas.com, David Woodhouse Use resource_size(). Signed-off-by: H Hartley Sweeten Cc: David Woodhouse Cc: Yoshihiro Shimoda Acked-by: Yoshihiro Shimoda --- diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c index 02bef21..4260ab7 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c @@ -797,7 +797,7 @@ static int __init flctl_probe(struct platform_device *pdev) goto err; } - flctl->reg = ioremap(res->start, res->end - res->start + 1); + flctl->reg = ioremap(res->start, resource_size(res)); if (flctl->reg == NULL) { printk(KERN_ERR "%s: ioremap error.\n", __func__); ret = -ENOMEM;