From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Hans de Goede <hansg@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Linus Walleij <linus.walleij@linaro.org>,
linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] gpiolib: Extend software-node support to support secondary software-nodes
Date: Sun, 21 Sep 2025 21:45:24 +0300 [thread overview]
Message-ID: <CAHp75Vdt6Fpt5JHzKFGLDGjeEV9io+D37FfbWWYMX6B4gc76+A@mail.gmail.com> (raw)
In-Reply-To: <d8e90507-49d1-4afa-a71a-ceacf5f89f82@kernel.org>
On Sun, Sep 21, 2025 at 4:00 PM Hans de Goede <hansg@kernel.org> wrote:
> On 20-Sep-25 11:27 PM, Dmitry Torokhov wrote:
> > On Sat, Sep 20, 2025 at 10:09:55PM +0200, Hans de Goede wrote:
...
> > Bikeshedding for later. Maybe do it like this in case we can have more
> > than 2 nodes at some point?
> >
> > do {
> > desc = gpiod_find_by_fwnode(fwnode, consumer, con_id, idx, flags, lookupflags);
> > if (!gpiod_not_found(desc))
> > return desc;
> >
> > fwnode = fwnode->secondary;
> > } while (!IS_ERR_OR_NULL(fwnode));
> >
> > return ERR_PTR(-ENOENT);
>
> At a minimum this would need to a regular while () {} loop then,
> the initial fwnode may also be NULL and we don't want to deref that.
>
> Andy did mention turning the fwnode-s into a regular linked-list
> in the future, but I think that would be using <linux/list.h> then,
> replacing the secondary pointer with a list head ?
Dropping secondary in the struct fwnode_handle and use struct
list_head somewhere else, e.g., struct device.
> >> +}
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-09-21 18:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-20 20:09 [PATCH v2] gpiolib: Extend software-node support to support secondary software-nodes Hans de Goede
2025-09-20 21:27 ` Dmitry Torokhov
2025-09-21 13:00 ` Hans de Goede
2025-09-21 18:45 ` Andy Shevchenko [this message]
2025-09-22 14:24 ` Bartosz Golaszewski
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=CAHp75Vdt6Fpt5JHzKFGLDGjeEV9io+D37FfbWWYMX6B4gc76+A@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=dmitry.torokhov@gmail.com \
--cc=hansg@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).