Skip to content

Commit bc96299

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: bcm2835: Switch to use ->add_pin_ranges()
Yeah, while the ->add_pin_ranges() shouldn't be used by DT drivers, this one requires it to support quite old firmware descriptions that do not have gpio-ranges property. The change allows to clean up GPIO library from OF specifics. There is no functional change intended. Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Stefan Wahren <[email protected]> Tested-by: Florian Fainelli <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Acked-by: Bartosz Golaszewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 2d578dd commit bc96299

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/pinctrl/bcm/pinctrl-bcm2835.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
358358
return 0;
359359
}
360360

361-
static int bcm2835_of_gpio_ranges_fallback(struct gpio_chip *gc,
362-
struct device_node *np)
361+
static int bcm2835_add_pin_ranges_fallback(struct gpio_chip *gc)
363362
{
363+
struct device_node *np = dev_of_node(gc->parent);
364364
struct pinctrl_dev *pctldev = of_pinctrl_get(np);
365365

366366
if (!pctldev)
@@ -386,7 +386,7 @@ static const struct gpio_chip bcm2835_gpio_chip = {
386386
.base = -1,
387387
.ngpio = BCM2835_NUM_GPIOS,
388388
.can_sleep = false,
389-
.of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback,
389+
.add_pin_ranges = bcm2835_add_pin_ranges_fallback,
390390
};
391391

392392
static const struct gpio_chip bcm2711_gpio_chip = {
@@ -403,7 +403,7 @@ static const struct gpio_chip bcm2711_gpio_chip = {
403403
.base = -1,
404404
.ngpio = BCM2711_NUM_GPIOS,
405405
.can_sleep = false,
406-
.of_gpio_ranges_fallback = bcm2835_of_gpio_ranges_fallback,
406+
.add_pin_ranges = bcm2835_add_pin_ranges_fallback,
407407
};
408408

409409
static void bcm2835_gpio_irq_handle_bank(struct bcm2835_pinctrl *pc,

0 commit comments

Comments
 (0)