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 <axel.lin@ingics.com> Acked-by: James Hogan <james.hogan@imgtec.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>hifive-unleashed-5.1
parent
a7ce835376
commit
08b89fa20b
|
@ -573,7 +573,7 @@ static int tz1090_gpio_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* Ioremap the registers */
|
/* Ioremap the registers */
|
||||||
priv.reg = devm_ioremap(&pdev->dev, res_regs->start,
|
priv.reg = devm_ioremap(&pdev->dev, res_regs->start,
|
||||||
res_regs->end - res_regs->start);
|
resource_size(res_regs));
|
||||||
if (!priv.reg) {
|
if (!priv.reg) {
|
||||||
dev_err(&pdev->dev, "unable to ioremap registers\n");
|
dev_err(&pdev->dev, "unable to ioremap registers\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in New Issue