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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MdvcQgOvEU+t8ck2EFJUtM_HSTR9cMZf4wVdtB3TRs5Zw@mail.gmail.com>
Date:   Wed, 9 Nov 2022 14:13:55 +0100
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v1 1/2] gpiolib: of: Prepare of_gpiochip_add() /
 of_gpiochip_remove() for fwnode

On Wed, Nov 9, 2022 at 2:13 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> On Mon, Nov 7, 2022 at 5:10 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> >
> > GPIO library is getting rid of of_node, fwnode should be utilized instead.
> > Prepare of_gpiochip_add() / of_gpiochip_remove() for fwnode.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > ---
> >  drivers/gpio/gpiolib-of.c | 10 ++++++----
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> > index be9c34cca322..000020eb78d8 100644
> > --- a/drivers/gpio/gpiolib-of.c
> > +++ b/drivers/gpio/gpiolib-of.c
> > @@ -1104,9 +1104,11 @@ static int of_gpiochip_add_pin_range(struct gpio_chip *chip) { return 0; }
> >
> >  int of_gpiochip_add(struct gpio_chip *chip)
> >  {
> > +       struct device_node *np;
> >         int ret;
> >
> > -       if (!chip->of_node)
> > +       np = to_of_node(chip->fwnode);
> > +       if (!np)
> >                 return 0;
> >
> >         if (!chip->of_xlate) {
> > @@ -1123,18 +1125,18 @@ int of_gpiochip_add(struct gpio_chip *chip)
> >         if (ret)
> >                 return ret;
> >
> > -       of_node_get(chip->of_node);
> > +       fwnode_handle_get(chip->fwnode);
> >
> >         ret = of_gpiochip_scan_gpios(chip);
> >         if (ret)
> > -               of_node_put(chip->of_node);
> > +               fwnode_handle_put(chip->fwnode);
> >
> >         return ret;
> >  }
> >
> >  void of_gpiochip_remove(struct gpio_chip *chip)
> >  {
> > -       of_node_put(chip->of_node);
> > +       fwnode_handle_put(chip->fwnode);
> >  }
> >
> >  void of_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev)
> > --
> > 2.35.1
> >
>
> Applied, thanks!
>
> Bart

I actually applied v2 and both the patches from this series.

Bart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ