[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MfgPsf78pPTD2zNYkjp6QYO2xFnzN-niEaVn7nkjnUB5A@mail.gmail.com>
Date: Thu, 6 Nov 2025 15:18:26 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de>,
Krzysztof Kozlowski <krzk@...nel.org>, linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v5 8/8] reset: gpio: use software nodes to setup the GPIO lookup
On Wed, Nov 5, 2025 at 3:10 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Wed, Nov 05, 2025 at 09:47:39AM +0100, Bartosz Golaszewski wrote:
> >
> > GPIO machine lookup is a nice mechanism for associating GPIOs with
> > consumers if we don't know what kind of device the GPIO provider is or
> > when it will become available. However in the case of the reset-gpio, we
> > are already holding a reference to the device and so can reference its
> > firmware node. Let's setup a software node that references the relevant
> > GPIO and attach it to the auxiliary device we're creating.
>
> ...
>
> > static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)
> > {
> > + struct property_entry properties[] = { {}, {} };
>
> It's an interesting way of saying this?
>
I hope this is the final round of nit-picking...
> struct property_entry properties[2] = { };
>
> > struct reset_gpio_lookup *rgpio_dev;
> > + unsigned int offset, of_flags;
> > + struct device *parent;
> > + int id, ret, lflags;
>
> I assumed that lflags shouldn't be signed. And IIRC they are unsigned long
> elsewhere (yes, just confirmed).
>
It doesn't really matter that much here but whatever. I do plan on
tackling the duplication of machine and OF flags at some point though.
> ...
>
> > + rgpio_dev->swnode = fwnode_create_software_node(properties, NULL);
> > + if (IS_ERR(rgpio_dev->swnode)) {
> > + ret = PTR_ERR(rgpio_dev->swnode);
> > + goto err_put_of_node;
> > + }
>
> Can save 1 LoC?
>
Oh come on...
Bart
> rgpio_dev->swnode = fwnode_create_software_node(properties, NULL);
> ret = PTR_ERR_OR_ZERO(rgpio_dev->swnode);
> if (ret)
> goto err_put_of_node;
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Powered by blists - more mailing lists