lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <mz6kajh7jkn5ly77rah2yxefgferlbpn2zngzeifgaoh5h4k57@iqojnv73sp4b>
Date: Wed, 7 May 2025 03:30:17 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Cc: Bjorn Andersson <andersson@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Guenter Roeck <linux@...ck-us.net>,
        Josh Cartwright <joshc@...eaurora.org>,
        Matti Vaittinen <mazziesaccount@...il.com>,
        Doug Anderson <dianders@...omium.org>, linux-arm-msm@...r.kernel.org,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] pinctrl: qcom: switch to devm_gpiochip_add_data()

On Tue, May 06, 2025 at 07:23:10PM +0200, Bartosz Golaszewski wrote:
> On Tue, 6 May 2025 at 19:18, Bartosz Golaszewski
> <bartosz.golaszewski@...aro.org> wrote:
> >
> > On Sat, 3 May 2025 at 07:32, Dmitry Baryshkov
> > <dmitry.baryshkov@....qualcomm.com> wrote:
> > >
> > > In order to simplify cleanup actions, use devres-enabled version of
> > > gpiochip_add_data().
> > >
> > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
> > > ---
> > >  drivers/pinctrl/qcom/pinctrl-msm.c | 6 +-----
> > >  1 file changed, 1 insertion(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> > > index 88dd462516c76d58b43d49accbddeea38af8f1ec..b2e8f7b3f3e3d5d232b2bd60e5cace62b21ffb03 100644
> > > --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> > > +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> > > @@ -1449,7 +1449,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
> > >         girq->handler = handle_bad_irq;
> > >         girq->parents[0] = pctrl->irq;
> > >
> > > -       ret = gpiochip_add_data(&pctrl->chip, pctrl);
> > > +       ret = devm_gpiochip_add_data(pctrl->dev, &pctrl->chip, pctrl);
> > >         if (ret) {
> > >                 dev_err(pctrl->dev, "Failed register gpiochip\n");
> > >                 return ret;
> > > @@ -1470,7 +1470,6 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
> > >                         dev_name(pctrl->dev), 0, 0, chip->ngpio);
> > >                 if (ret) {
> > >                         dev_err(pctrl->dev, "Failed to add pin range\n");
> > > -                       gpiochip_remove(&pctrl->chip);
> > >                         return ret;
> > >                 }
> > >         }
> > > @@ -1608,9 +1607,6 @@ EXPORT_SYMBOL(msm_pinctrl_probe);
> > >
> > >  void msm_pinctrl_remove(struct platform_device *pdev)
> > >  {
> > > -       struct msm_pinctrl *pctrl = platform_get_drvdata(pdev);
> > > -
> > > -       gpiochip_remove(&pctrl->chip);
> > >  }
> > >  EXPORT_SYMBOL(msm_pinctrl_remove);
> > >
> > >
> > > --
> > > 2.39.5
> > >
> >
> > If you're at it then why not remove this function here and the
> > callback assignment throughout the pinctrl/qcom/ directory?
> >
> > Bart
> 
> Ah, it's in the next patch. I'd make it one commit though, no reason
> to split it IMO.

Up to you, but from my POV it's cleaner this way: first patch removes
the contents, second one removes the function. Otherwise it's too easy
to loose the functional changes (of gpiochip_remove() removal) in the
noise of updating all the platform files.

If you wish, I can add a note to the commit message telling that the
actual function will be dropped in the next commit.

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ