gpio: tz1090: Use resource_size to fix off-by-one resource size calculation
PATCH 1/2 gpio: tz1090: Use resource_size to fix off-by-one resource size calculation
Signed-off-by Axel Lin <[email protected]>
--- drivers/gpio/gpio-tz1090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-tz1090.c +1 -1
@@ -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 ;
Signature · 1 line
1.9.1
PATCH 2/2 gpio: tz1090-pdc: Use resource_size to fix off-by-one resource size calculation
Signed-off-by Axel Lin <[email protected]>
--- drivers/gpio/gpio-tz1090-pdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-tz1090-pdc.c +1 -1
@@ -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 ;
Signature · 1 line
1.9.1
Re: [PATCH 2/2] gpio: tz1090-pdc: Use resource_size to fix off-by-one resource size calculation
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Thanks, both patches
Acked-by James Hogan <[email protected]>
Note that the previous off-by-one behaviour should be harmless since the SoC IO memory region is unmapped on Meta (i.e. the ioremap becomes a no-op as the whole of IO memory is accessible with normal memory accesses regardless of MMU).
Cheers
James
Quoted 18 lines
--- drivers/gpio/gpio-tz1090-pdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpio/gpio-tz1090-pdc.c +1
-1@@ -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 ;