From 68d77d5168bdb922e0f100d0ee5e5e78aa0989af Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 21 Jan 2015 09:52:01 +0800 Subject: [PATCH] gpio: tz1090-pdc: Use resource_size to fix off-by-one resource size calculation Signed-off-by: Axel Lin Acked-by: James Hogan Signed-off-by: Linus Walleij --- drivers/gpio/gpio-tz1090-pdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-tz1090-pdc.c b/drivers/gpio/gpio-tz1090-pdc.c index d753622..ede7e40 100644 --- a/drivers/gpio/gpio-tz1090-pdc.c +++ b/drivers/gpio/gpio-tz1090-pdc.c @@ -190,7 +190,7 @@ static int tz1090_pdc_gpio_probe(struct platform_device *pdev) /* Ioremap the registers */ priv->reg = devm_ioremap(&pdev->dev, res_regs->start, - res_regs->end - res_regs->start); + resource_size(res_regs)); if (!priv->reg) { dev_err(&pdev->dev, "unable to ioremap registers\n"); return -ENOMEM; -- 2.7.4