Linux SOC development
 help / color / mirror / Atom feed
* [PATCH 17/36] pinctrl: spear: use new pinctrl GPIO helpers
       [not found] <20231003145114.21637-1-brgl@bgdev.pl>
@ 2023-10-03 14:50 ` Bartosz Golaszewski
  2023-10-04  6:01   ` Viresh Kumar
  2023-12-06 16:19   ` patchwork-bot+linux-soc
  0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2023-10-03 14:50 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski, Viresh Kumar,
	Shiraz Hashim, soc

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);
 }
 
 /* PLGPIO IRQ */
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 17/36] pinctrl: spear: use new pinctrl GPIO helpers
  2023-10-03 14:50 ` [PATCH 17/36] pinctrl: spear: use new pinctrl GPIO helpers Bartosz Golaszewski
@ 2023-10-04  6:01   ` Viresh Kumar
  2023-12-06 16:19   ` patchwork-bot+linux-soc
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2023-10-04  6:01 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel,
	Bartosz Golaszewski, Viresh Kumar, Shiraz Hashim, soc

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>

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 17/36] pinctrl: spear: use new pinctrl GPIO helpers
  2023-10-03 14:50 ` [PATCH 17/36] pinctrl: spear: use new pinctrl GPIO helpers Bartosz Golaszewski
  2023-10-04  6:01   ` Viresh Kumar
@ 2023-12-06 16:19   ` patchwork-bot+linux-soc
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-soc @ 2023-12-06 16:19 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: soc

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-06 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20231003145114.21637-1-brgl@bgdev.pl>
2023-10-03 14:50 ` [PATCH 17/36] pinctrl: spear: use new pinctrl GPIO helpers Bartosz Golaszewski
2023-10-04  6:01   ` Viresh Kumar
2023-12-06 16:19   ` patchwork-bot+linux-soc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox