[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MeEKuSDRs2GjgFFYH2fAqr2KGhnoEGq7Jgh0S1DdqaoTg@mail.gmail.com>
Date: Wed, 4 Oct 2023 11:39:00 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Emil Renner Berthing <emil.renner.berthing@...onical.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Andy Shevchenko <andy@...nel.org>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
Emil Renner Berthing <kernel@...il.dk>,
Jianlong Huang <jianlong.huang@...rfivetech.com>,
Hal Feng <hal.feng@...rfivetech.com>
Subject: Re: [PATCH 18/36] pinctrl: starfive: use new pinctrl GPIO helpers
On Wed, Oct 4, 2023 at 11:37 AM Emil Renner Berthing
<emil.renner.berthing@...onical.com> wrote:
>
> Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@...aro.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@...aro.org>
> > ---
> > drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 4 ++--
> > drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 4 ++--
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> > index 530fe340a9a1..22a2db8fa315 100644
> > --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> > +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> > @@ -918,12 +918,12 @@ static struct pinctrl_desc starfive_desc = {
> >
> > static int starfive_gpio_request(struct gpio_chip *gc, unsigned int gpio)
> > {
> > - return pinctrl_gpio_request(gc->base + gpio);
> > + return pinctrl_gpio_request_new(gc, gpio);
> > }
> >
> > static void starfive_gpio_free(struct gpio_chip *gc, unsigned int gpio)
> > {
> > - pinctrl_gpio_free(gc->base + gpio);
> > + pinctrl_gpio_free_new(gc, gpio);
>
> Hi Bartosz,
>
> Thank you for the patch. These new pinctrl_gpio_*_new() functions now seem to
> have the same signature as the starfive_gpio_*() functions. Is there a reason
> they can't be used as callbacks directly so we could just delete the
> starfive_gpio_*() wrapppers?
Ha! Make sense and it'll probably apply to more users.
>
> Also it'd be great to be to be CC'd on at least the first generic patches where
> the new functions are introduced to have some context without having to look it
> up on lore.
>
I wanted to reduce noise for maintainers but ended up introducing
confusion. I will probably just send the v2 to everyone so proper
context.
Bart
> /Emil
>
> > }
> >
> > static int starfive_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
> > diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
> > index 640f827a9b2c..5557ef3fbeb2 100644
> > --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
> > +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
> > @@ -547,12 +547,12 @@ static const struct pinconf_ops jh7110_pinconf_ops = {
> >
> > static int jh7110_gpio_request(struct gpio_chip *gc, unsigned int gpio)
> > {
> > - return pinctrl_gpio_request(gc->base + gpio);
> > + return pinctrl_gpio_request_new(gc, gpio);
> > }
> >
> > static void jh7110_gpio_free(struct gpio_chip *gc, unsigned int gpio)
> > {
> > - pinctrl_gpio_free(gc->base + gpio);
> > + pinctrl_gpio_free_new(gc, gpio);
> > }
> >
> > static int jh7110_gpio_get_direction(struct gpio_chip *gc,
> > --
> > 2.39.2
Powered by blists - more mailing lists