Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7fc5fba authored by Neil Armstrong's avatar Neil Armstrong Committed by Linus Walleij
Browse files

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: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5fb7edb3
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -555,22 +555,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc)
	if (ret) {
		dev_err(pc->dev, "can't add gpio chip %s\n",
			pc->data->name);
		goto fail;
	}

	ret = gpiochip_add_pin_range(&pc->chip, dev_name(pc->dev),
				     0, pc->data->pin_base,
				     pc->chip.ngpio);
	if (ret) {
		dev_err(pc->dev, "can't add pin range\n");
		goto fail;
		return ret;
	}

	return 0;
fail:
	gpiochip_remove(&pc->chip);

	return ret;
}

static struct regmap_config meson_regmap_config = {