diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-02-14 16:35:09 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-03-15 08:33:39 -0400 |
commit | 934cb02bab9003bf65afe73e9146a1ea63b26c40 (patch) | |
tree | 4388d27ec6313aa85bf0f9829eb05fbf89dfae4b /drivers/pinctrl/sh-pfc/gpio.c | |
parent | 0b73ee5d534cc6dcb96efb9eac4cf96b40910911 (diff) |
sh-pfc: Add function to retrieve a pin instance from its pin number
This prepares support for sparse pin numbering. The function currently
just performs and indexed lookup in the pins array.
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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/sh-pfc/gpio.c b/drivers/pinctrl/sh-pfc/gpio.c index db9af4e548a0..45090d8381a2 100644 --- a/drivers/pinctrl/sh-pfc/gpio.c +++ b/drivers/pinctrl/sh-pfc/gpio.c | |||
@@ -43,8 +43,9 @@ static struct sh_pfc *gpio_to_pfc(struct gpio_chip *gc) | |||
43 | static int gpio_pin_request(struct gpio_chip *gc, unsigned offset) | 43 | static int gpio_pin_request(struct gpio_chip *gc, unsigned offset) |
44 | { | 44 | { |
45 | struct sh_pfc *pfc = gpio_to_pfc(gc); | 45 | struct sh_pfc *pfc = gpio_to_pfc(gc); |
46 | struct sh_pfc_pin *pin = sh_pfc_get_pin(pfc, offset); | ||
46 | 47 | ||
47 | if (pfc->info->pins[offset].enum_id == 0) | 48 | if (pin->enum_id == 0) |
48 | return -EINVAL; | 49 | return -EINVAL; |
49 | 50 | ||
50 | return pinctrl_request_gpio(offset); | 51 | return pinctrl_request_gpio(offset); |