diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-11-28 17:51:00 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-15 13:33:36 +0100 |
commit | d7a7ca5781fa2ac40319acc7125c487db5b26d91 (patch) | |
tree | 23ad6199057643515f3fb7d9abb9acd646670dd4 /drivers/pinctrl/sh-pfc/gpio.c | |
parent | 35ad42719efcd25d310d1ad5f8b0f3a5c68e671d (diff) | |
download | lwn-d7a7ca5781fa2ac40319acc7125c487db5b26d91.tar.gz lwn-d7a7ca5781fa2ac40319acc7125c487db5b26d91.zip |
sh-pfc: Replace first_gpio and last_gpio with nr_gpios
The SoC information first_gpio field is always equal to 0, and the
last_gpio field is the index of the last entry in the pinmux_gpios
array. Replace the first_gpio and last_gpio fields by a nr_gpios field,
and initialize it to ARRAY_SIZE(pinmux_gpios).
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sh-pfc/gpio.c')
-rw-r--r-- | drivers/pinctrl/sh-pfc/gpio.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c index a535075c8b69..f46f06997b99 100644 --- a/drivers/pinctrl/sh-pfc/gpio.c +++ b/drivers/pinctrl/sh-pfc/gpio.c @@ -130,12 +130,10 @@ static void sh_pfc_gpio_setup(struct sh_pfc_chip *chip) gc->set = sh_gpio_set; gc->to_irq = sh_gpio_to_irq; - WARN_ON(pfc->info->first_gpio != 0); /* needs testing */ - gc->label = pfc->info->name; gc->owner = THIS_MODULE; - gc->base = pfc->info->first_gpio; - gc->ngpio = (pfc->info->last_gpio - pfc->info->first_gpio) + 1; + gc->base = 0; + gc->ngpio = pfc->info->nr_gpios; } int sh_pfc_register_gpiochip(struct sh_pfc *pfc) @@ -157,9 +155,8 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc) pfc->gpio = chip; - pr_info("%s handling gpio %d -> %d\n", - pfc->info->name, pfc->info->first_gpio, - pfc->info->last_gpio); + pr_info("%s handling gpio 0 -> %u\n", + pfc->info->name, pfc->info->nr_gpios - 1); return 0; } |