Patchwork drivers/mtd/nand/sh_flctl.c: use resource_size()

login
register
mail settings
Submitter hartleys
Date Dec. 14, 2009, 9:59 p.m.
Message ID <BD79186B4FD85F4B8E60E381CAEE19090200EA68@mi8nycmail19.Mi8.com>
Download mbox | patch
Permalink /patch/41152/
State New
Headers show

Comments

hartleys - Dec. 14, 2009, 9:59 p.m.
Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>

---
Yoshihiro Shimoda - Dec. 16, 2009, 12:48 a.m.
H Hartley Sweeten wrote:
> Use resource_size().
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>

Thank you for your patch!

Acked-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>

Thanks,
Yoshihiro Shimoda

Patch

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;