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

Commit 98c85d58 authored by Jonas Gorski's avatar Jonas Gorski Committed by Linus Walleij
Browse files

pinctrl: replace trivial implementations of gpio_chip request/free



Replace all trivial request/free callbacks that do nothing but call into
pinctrl code with the generic versions.

Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
Acked-by: default avatarBjorn Andersson <bjorn.andersson@sonymobile.com>
Acked-by: default avatarHeiko Stuebner <heiko@sntech.de>
Acked-by: default avatarEric Anholt <eric@anholt.net>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: default avatarAndrew Bresticker <abrestic@chromium.org>
Acked-by: default avatarBaruch Siach <baruch@tkos.co.il>
Acked-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Acked-by: default avatarLee Jones <lee@kernel.org>
Acked-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 31831f41
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -330,16 +330,6 @@ static inline void bcm2835_pinctrl_fsel_set(
	bcm2835_gpio_wr(pc, FSEL_REG(pin), val);
}

static int bcm2835_gpio_request(struct gpio_chip *chip, unsigned offset)
{
	return pinctrl_request_gpio(chip->base + offset);
}

static void bcm2835_gpio_free(struct gpio_chip *chip, unsigned offset)
{
	pinctrl_free_gpio(chip->base + offset);
}

static int bcm2835_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
{
	return pinctrl_gpio_direction_input(chip->base + offset);
@@ -375,8 +365,8 @@ static int bcm2835_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
static struct gpio_chip bcm2835_gpio_chip = {
	.label = MODULE_NAME,
	.owner = THIS_MODULE,
	.request = bcm2835_gpio_request,
	.free = bcm2835_gpio_free,
	.request = gpiochip_generic_request,
	.free = gpiochip_generic_free,
	.direction_input = bcm2835_gpio_direction_input,
	.direction_output = bcm2835_gpio_direction_output,
	.get = bcm2835_gpio_get,
+2 −12
Original line number Diff line number Diff line
@@ -1149,16 +1149,6 @@ static struct pinctrl_desc chv_pinctrl_desc = {
	.owner = THIS_MODULE,
};

static int chv_gpio_request(struct gpio_chip *chip, unsigned offset)
{
	return pinctrl_request_gpio(chip->base + offset);
}

static void chv_gpio_free(struct gpio_chip *chip, unsigned offset)
{
	pinctrl_free_gpio(chip->base + offset);
}

static unsigned chv_gpio_offset_to_pin(struct chv_pinctrl *pctrl,
				       unsigned offset)
{
@@ -1238,8 +1228,8 @@ static int chv_gpio_direction_output(struct gpio_chip *chip, unsigned offset,

static const struct gpio_chip chv_gpio_chip = {
	.owner = THIS_MODULE,
	.request = chv_gpio_request,
	.free = chv_gpio_free,
	.request = gpiochip_generic_request,
	.free = gpiochip_generic_free,
	.get_direction = chv_gpio_get_direction,
	.direction_input = chv_gpio_direction_input,
	.direction_output = chv_gpio_direction_output,
+2 −12
Original line number Diff line number Diff line
@@ -597,16 +597,6 @@ static const struct pinctrl_desc intel_pinctrl_desc = {
	.owner = THIS_MODULE,
};

static int intel_gpio_request(struct gpio_chip *chip, unsigned offset)
{
	return pinctrl_request_gpio(chip->base + offset);
}

static void intel_gpio_free(struct gpio_chip *chip, unsigned offset)
{
	pinctrl_free_gpio(chip->base + offset);
}

static int intel_gpio_get(struct gpio_chip *chip, unsigned offset)
{
	struct intel_pinctrl *pctrl = gpiochip_to_pinctrl(chip);
@@ -654,8 +644,8 @@ static int intel_gpio_direction_output(struct gpio_chip *chip, unsigned offset,

static const struct gpio_chip intel_gpio_chip = {
	.owner = THIS_MODULE,
	.request = intel_gpio_request,
	.free = intel_gpio_free,
	.request = gpiochip_generic_request,
	.free = gpiochip_generic_free,
	.direction_input = intel_gpio_direction_input,
	.direction_output = intel_gpio_direction_output,
	.get = intel_gpio_get,
+2 −12
Original line number Diff line number Diff line
@@ -723,16 +723,6 @@ static const struct pinmux_ops mtk_pmx_ops = {
	.gpio_set_direction	= mtk_pmx_gpio_set_direction,
};

static int mtk_gpio_request(struct gpio_chip *chip, unsigned offset)
{
	return pinctrl_request_gpio(chip->base + offset);
}

static void mtk_gpio_free(struct gpio_chip *chip, unsigned offset)
{
	pinctrl_free_gpio(chip->base + offset);
}

static int mtk_gpio_direction_input(struct gpio_chip *chip,
					unsigned offset)
{
@@ -1005,8 +995,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,

static struct gpio_chip mtk_gpio_chip = {
	.owner			= THIS_MODULE,
	.request		= mtk_gpio_request,
	.free			= mtk_gpio_free,
	.request		= gpiochip_generic_request,
	.free			= gpiochip_generic_free,
	.direction_input	= mtk_gpio_direction_input,
	.direction_output	= mtk_gpio_direction_output,
	.get			= mtk_gpio_get,
+2 −16
Original line number Diff line number Diff line
@@ -654,25 +654,11 @@ static inline void abx500_gpio_dbg_show_one(struct seq_file *s,
#define abx500_gpio_dbg_show	NULL
#endif

static int abx500_gpio_request(struct gpio_chip *chip, unsigned offset)
{
	int gpio = chip->base + offset;

	return pinctrl_request_gpio(gpio);
}

static void abx500_gpio_free(struct gpio_chip *chip, unsigned offset)
{
	int gpio = chip->base + offset;

	pinctrl_free_gpio(gpio);
}

static struct gpio_chip abx500gpio_chip = {
	.label			= "abx500-gpio",
	.owner			= THIS_MODULE,
	.request		= abx500_gpio_request,
	.free			= abx500_gpio_free,
	.request		= gpiochip_generic_request,
	.free			= gpiochip_generic_free,
	.direction_input	= abx500_gpio_direction_input,
	.get			= abx500_gpio_get,
	.direction_output	= abx500_gpio_direction_output,
Loading