Message ID | 20231003145114.21637-18-brgl@bgdev.pl (mailing list archive) |
---|---|
State | Accepted |
Commit | a3305049053a66e04def76e62fc94d7980d88a84 |
Headers | show |
Series | None | expand |
On 03-10-23, 16:50, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > Replace the pinctrl helpers taking the global GPIO number as argument > with the improved variants that instead take a pointer to the GPIO chip > and the controller-relative offset. > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > --- > drivers/pinctrl/spear/pinctrl-plgpio.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c > index 722681e0b89b..7488f6394318 100644 > --- a/drivers/pinctrl/spear/pinctrl-plgpio.c > +++ b/drivers/pinctrl/spear/pinctrl-plgpio.c > @@ -204,14 +204,13 @@ static void plgpio_set_value(struct gpio_chip *chip, unsigned offset, int value) > static int plgpio_request(struct gpio_chip *chip, unsigned offset) > { > struct plgpio *plgpio = gpiochip_get_data(chip); > - int gpio = chip->base + offset; > unsigned long flags; > int ret = 0; > > if (offset >= chip->ngpio) > return -EINVAL; > > - ret = pinctrl_gpio_request(gpio); > + ret = pinctrl_gpio_request_new(chip, offset); > if (ret) > return ret; > > @@ -249,14 +248,13 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset) > if (!IS_ERR(plgpio->clk)) > clk_disable(plgpio->clk); > err0: > - pinctrl_gpio_free(gpio); > + pinctrl_gpio_free_new(chip, offset); > return ret; > } > > static void plgpio_free(struct gpio_chip *chip, unsigned offset) > { > struct plgpio *plgpio = gpiochip_get_data(chip); > - int gpio = chip->base + offset; > unsigned long flags; > > if (offset >= chip->ngpio) > @@ -280,7 +278,7 @@ static void plgpio_free(struct gpio_chip *chip, unsigned offset) > if (!IS_ERR(plgpio->clk)) > clk_disable(plgpio->clk); > > - pinctrl_gpio_free(gpio); > + pinctrl_gpio_free_new(chip, offset); > } Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Hello: This patch was applied to soc/soc.git (arm/fixes) by Bartosz Golaszewski <bartosz.golaszewski@linaro.org>: On Tue, 3 Oct 2023 16:50:55 +0200 you wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > Replace the pinctrl helpers taking the global GPIO number as argument > with the improved variants that instead take a pointer to the GPIO chip > and the controller-relative offset. > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > [...] Here is the summary with links: - [17/36] pinctrl: spear: use new pinctrl GPIO helpers https://git.kernel.org/soc/soc/c/a3305049053a You are awesome, thank you!
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c index 722681e0b89b..7488f6394318 100644 --- a/drivers/pinctrl/spear/pinctrl-plgpio.c +++ b/drivers/pinctrl/spear/pinctrl-plgpio.c @@ -204,14 +204,13 @@ static void plgpio_set_value(struct gpio_chip *chip, unsigned offset, int value) static int plgpio_request(struct gpio_chip *chip, unsigned offset) { struct plgpio *plgpio = gpiochip_get_data(chip); - int gpio = chip->base + offset; unsigned long flags; int ret = 0; if (offset >= chip->ngpio) return -EINVAL; - ret = pinctrl_gpio_request(gpio); + ret = pinctrl_gpio_request_new(chip, offset); if (ret) return ret; @@ -249,14 +248,13 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset) if (!IS_ERR(plgpio->clk)) clk_disable(plgpio->clk); err0: - pinctrl_gpio_free(gpio); + pinctrl_gpio_free_new(chip, offset); return ret; } static void plgpio_free(struct gpio_chip *chip, unsigned offset) { struct plgpio *plgpio = gpiochip_get_data(chip); - int gpio = chip->base + offset; unsigned long flags; if (offset >= chip->ngpio) @@ -280,7 +278,7 @@ static void plgpio_free(struct gpio_chip *chip, unsigned offset) if (!IS_ERR(plgpio->clk)) clk_disable(plgpio->clk); - pinctrl_gpio_free(gpio); + pinctrl_gpio_free_new(chip, offset); } /* PLGPIO IRQ */