Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: meson: use gpio-ranges from DT

When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges
is needed when gpiochip_add_data() is called but in the current implementation
the ranges are added from the driver afterwards.

A simple solution is to rely on the DR gpio-ranges attribute and remove the
call to gpiochip_add_pin_range().

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Neil Armstrong and committed by
Linus Walleij
c7fc5fba 5fb7edb3

+1 -13
+1 -13
drivers/pinctrl/meson/pinctrl-meson.c
··· 555 555 if (ret) { 556 556 dev_err(pc->dev, "can't add gpio chip %s\n", 557 557 pc->data->name); 558 - goto fail; 559 - } 560 - 561 - ret = gpiochip_add_pin_range(&pc->chip, dev_name(pc->dev), 562 - 0, pc->data->pin_base, 563 - pc->chip.ngpio); 564 - if (ret) { 565 - dev_err(pc->dev, "can't add pin range\n"); 566 - goto fail; 558 + return ret; 567 559 } 568 560 569 561 return 0; 570 - fail: 571 - gpiochip_remove(&pc->chip); 572 - 573 - return ret; 574 562 } 575 563 576 564 static struct regmap_config meson_regmap_config = {