From: Axel Lin Date: Sun, 28 Dec 2014 06:00:39 +0000 (+0800) Subject: gpio: tz1090: Use resource_size to fix off-by-one X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=08b89fa20bf292b6b7cd4c7fbaa6c147d4cc9e07;p=linux-beck.git gpio: tz1090: Use resource_size to fix off-by-one 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 --- diff --git a/drivers/gpio/gpio-tz1090.c b/drivers/gpio/gpio-tz1090.c index e3024bbba447..445660adc898 100644 --- a/drivers/gpio/gpio-tz1090.c +++ b/drivers/gpio/gpio-tz1090.c @@ -573,7 +573,7 @@ static int tz1090_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;