From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-gpio@vger.kernel.org
Subject: Re: [PATCH v3 5/6] gpiolib: consolidate GPIO lookups
Date: Thu, 10 Nov 2022 09:24:13 -0800 [thread overview]
Message-ID: <Y20zvUeRvnVPtUs+@google.com> (raw)
In-Reply-To: <Y20HJe/vQPI4dWyW@smile.fi.intel.com>
On Thu, Nov 10, 2022 at 04:13:57PM +0200, Andy Shevchenko wrote:
> On Wed, Nov 09, 2022 at 11:30:43AM -0800, Dmitry Torokhov wrote:
> > Ensure that all paths to obtain/look up GPIOD from generic
> > consumer-visible APIs go through the new gpiod_find_and_request()
> > helper, so that we can easily extend it with support for new firmware
> > mechanisms.
> >
> > The only exception is OF-specific [devm_]gpiod_get_from_of_node() API
> > that is still being used by a couple of drivers and will be removed as
> > soon as patches converting them to use generic fwnode/device APIs are
> > accepted.
>
> ...
>
> > + if (!IS_ERR_OR_NULL(fwnode))
>
> As pointed earlier I still think this is not needed. Even for the sake of
> showing an intent, the not-found fwnode(i.e. GPIO), will be handled anyway...
>
> > + desc = gpiod_find_by_fwnode(fwnode, consumer, con_id, idx,
> > + &flags, &lookupflags);
> > +
> > + if (gpiod_not_found(desc) && platform_lookup_allowed) {
>
> ...here by gpiod_not_found() which is an exact intention in both cases above
> (fwnode is not provided / invalid or GPIO wasn't found).
Thank you for the thorough reviews.
I think at this point I will leave to to Bart and Linus to decide what
form they prefer here. From the execution point there is no practical
difference, it is all syntactic sugar.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2022-11-10 17:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 19:30 [PATCH v3 0/6] Add support for software nodes to gpiolib Dmitry Torokhov
2022-11-09 19:30 ` [PATCH v3 1/6] gpiolib: of: change of_find_gpio() to accept device node Dmitry Torokhov
2022-11-09 19:30 ` [PATCH v3 2/6] gpiolib: acpi: change acpi_find_gpio() to accept firmware node Dmitry Torokhov
2022-11-09 19:30 ` [PATCH v3 3/6] gpiolib: acpi: teach acpi_find_gpio() to handle data-only nodes Dmitry Torokhov
2022-11-09 19:30 ` [PATCH v3 4/6] gpiolib: acpi: avoid leaking ACPI details into upper gpiolib layers Dmitry Torokhov
2022-11-09 19:30 ` [PATCH v3 5/6] gpiolib: consolidate GPIO lookups Dmitry Torokhov
2022-11-10 14:13 ` Andy Shevchenko
2022-11-10 17:24 ` Dmitry Torokhov [this message]
2022-11-09 19:30 ` [PATCH v3 6/6] gpiolib: add support for software nodes Dmitry Torokhov
2022-11-10 14:15 ` Andy Shevchenko
2022-11-11 21:49 ` [PATCH v3 0/6] Add support for software nodes to gpiolib Bartosz Golaszewski
2022-11-11 22:06 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y20zvUeRvnVPtUs+@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.