Re: [PATCH 4/4] gpiolib: rename local offset variables to "hwgpio"

From: Ryan Mallon
Date: Wed Feb 13 2013 - 17:54:31 EST


On 13/02/13 18:03, Alexandre Courbot wrote:
> From: Alexandre Courbot <acourbot@xxxxxxxxxx>
>
> Their value being obtained by gpio_chip_hwgpio(), this better reflects
> their use.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---
> drivers/gpio/gpiolib.c | 70 +++++++++++++++++++++++++-------------------------
> 1 file changed, 35 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index d8aa1a0..42838c2 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -72,7 +72,7 @@ struct gpio_desc {
> };
> static struct gpio_desc gpio_desc[ARCH_NR_GPIOS];
>
> -#define GPIO_OFFSET_VALID(chip, offset) (offset >= 0 && offset < chip->ngpio)
> +#define GPIO_HWNUM_VALID(chip, hwgpio) (hwgpio >= 0 && hwgpio < chip->ngpio)

Nitpicky - Is it accurate to call these hardware numbers? Don't some of
the platforms remap the gpio numbers? These numbers may not match
against the platform's datasheet for example.

~Ryan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/