Re: [PATCH 2/2] gpio: tz1090-pdc: Use resource_size to fix off-by-one resource size calculation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/12/14 06:01, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>

Thanks, both patches
Acked-by: James Hogan <james.hogan@xxxxxxxxxx>

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

> ---
>  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;
> 

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux