diff mbox series

[RFT] pinctrl: da9062: replace gpiochip_get_desc() with gpio_device_get_desc()

Message ID 20240618111824.15593-1-brgl@bgdev.pl
State New
Headers show
Series [RFT] pinctrl: da9062: replace gpiochip_get_desc() with gpio_device_get_desc() | expand

Commit Message

Bartosz Golaszewski June 18, 2024, 11:18 a.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

In order to finally confine the unsafe gpiochip_get_desc() to
drivers/gpio/, let's convert this driver to using the safer alternative
that takes the gpio_device as argument.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/pinctrl/pinctrl-da9062.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij June 18, 2024, 11:27 a.m. UTC | #1
On Tue, Jun 18, 2024 at 1:18 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> In order to finally confine the unsafe gpiochip_get_desc() to
> drivers/gpio/, let's convert this driver to using the safer alternative
> that takes the gpio_device as argument.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

I guess you will apply this to the GPIO tree, else tell me what to do!

Yours,
Linus Walleij
Bartosz Golaszewski June 18, 2024, 11:34 a.m. UTC | #2
On Tue, Jun 18, 2024 at 1:27 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Tue, Jun 18, 2024 at 1:18 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > In order to finally confine the unsafe gpiochip_get_desc() to
> > drivers/gpio/, let's convert this driver to using the safer alternative
> > that takes the gpio_device as argument.
> >
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> I guess you will apply this to the GPIO tree, else tell me what to do!
>
> Yours,
> Linus Walleij

I can, yes. Thank you.

I'll give it some time to possibly get a Tested-by from Dialog.

Bart
Bartosz Golaszewski June 25, 2024, 7:13 a.m. UTC | #3
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Tue, 18 Jun 2024 13:18:24 +0200, Bartosz Golaszewski wrote:
> In order to finally confine the unsafe gpiochip_get_desc() to
> drivers/gpio/, let's convert this driver to using the safer alternative
> that takes the gpio_device as argument.
> 
> 

Applied, thanks!

[1/1] pinctrl: da9062: replace gpiochip_get_desc() with gpio_device_get_desc()
      commit: 8657af6c0a9afaa11947b7476119834898823b52

Best regards,
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-da9062.c b/drivers/pinctrl/pinctrl-da9062.c
index 22e3cd2cc963..6f44a13b90ce 100644
--- a/drivers/pinctrl/pinctrl-da9062.c
+++ b/drivers/pinctrl/pinctrl-da9062.c
@@ -139,7 +139,7 @@  static int da9062_gpio_direction_input(struct gpio_chip *gc,
 {
 	struct da9062_pctl *pctl = gpiochip_get_data(gc);
 	struct regmap *regmap = pctl->da9062->regmap;
-	struct gpio_desc *desc = gpiochip_get_desc(gc, offset);
+	struct gpio_desc *desc = gpio_device_get_desc(gc->gpiodev, offset);
 	unsigned int gpi_type;
 	int ret;