Adding a GPIO range to a pinctrl device logically belongs to the GPIO
driver. Switch to the right API.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
{
struct sh_pfc_chip *chip;
+ int ret;
chip = sh_pfc_add_gpiochip(pfc, gpio_pin_setup);
if (IS_ERR(chip))
pfc->gpio = chip;
+ ret = gpiochip_add_pin_range(&chip->gpio_chip, dev_name(pfc->dev), 0, 0,
+ chip->gpio_chip.ngpio);
+ if (ret < 0)
+ return ret;
+
chip = sh_pfc_add_gpiochip(pfc, gpio_function_setup);
if (IS_ERR(chip))
return PTR_ERR(chip);
struct sh_pfc_pinctrl {
struct pinctrl_dev *pctl;
struct pinctrl_desc pctl_desc;
- struct pinctrl_gpio_range range;
struct sh_pfc *pfc;
if (IS_ERR(pmx->pctl))
return PTR_ERR(pmx->pctl);
- pmx->range.name = DRV_NAME,
- pmx->range.id = 0;
- pmx->range.npins = pfc->info->nr_pins;
- pmx->range.base = 0;
- pmx->range.pin_base = 0;
-
- pinctrl_add_gpio_range(pmx->pctl, &pmx->range);
-
return 0;
}