[PATCH v2 0/2] driver core: provide and use device_match_fwnode_ext()

Bartosz Golaszewski posted 2 patches 1 month, 1 week ago
drivers/base/core.c    |  5 -----
drivers/gpio/gpiolib.c | 12 +++++++++++-
include/linux/fwnode.h |  5 +++++
3 files changed, 16 insertions(+), 6 deletions(-)
[PATCH v2 0/2] driver core: provide and use device_match_fwnode_ext()
Posted by Bartosz Golaszewski 1 month, 1 week ago
In GPIOLIB, during fwnode lookup, after having resolved the consumer's
reference to a specific fwnode, we only match it against the primary
node of the controllers. Let's extend that to also the secondary node by
exposing fwnode_is_primary() to drivers and reworking
gpio_chip_match_by_fwnode().

Link: https://lore.kernel.org/all/aZUIFiOYt6GOlDQx@google.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Changes in v2:
- Fold the code initially put into driver code into GPIOLIB as advised
  by Rafael
- Rework the logic as suggested by Andy
- To that end: make fwnode_is_primary() public
- Link to v1: https://patch.msgid.link/20260219-device-match-secondary-fwnode-v1-0-a64e8d4754bc@oss.qualcomm.com

---
Bartosz Golaszewski (2):
      driver core: make fwnode_is_primary() public
      gpiolib: match secondary fwnode too in gpio_device_find_by_fwnode()

 drivers/base/core.c    |  5 -----
 drivers/gpio/gpiolib.c | 12 +++++++++++-
 include/linux/fwnode.h |  5 +++++
 3 files changed, 16 insertions(+), 6 deletions(-)
---
base-commit: 50f68cc7be0a2cbf54d8f6aaf17df32fb01acc3f
change-id: 20260219-device-match-secondary-fwnode-4cc163ec47ee

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Re: [PATCH v2 0/2] driver core: provide and use device_match_fwnode_ext()
Posted by Bartosz Golaszewski 1 month, 1 week ago
On Mon, Feb 23, 2026 at 4:41 PM Bartosz Golaszewski
<bartosz.golaszewski@oss.qualcomm.com> wrote:
>
> In GPIOLIB, during fwnode lookup, after having resolved the consumer's
> reference to a specific fwnode, we only match it against the primary
> node of the controllers. Let's extend that to also the secondary node by
> exposing fwnode_is_primary() to drivers and reworking
> gpio_chip_match_by_fwnode().
>
> Link: https://lore.kernel.org/all/aZUIFiOYt6GOlDQx@google.com/
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---

Forgot to pick up Linus' R-b:

Reviewed-by: Linus Walleij <linusw@kernel.org>

Rafael: is it fine if I take it through the GPIO tree?

Bart
Re: [PATCH v2 0/2] driver core: provide and use device_match_fwnode_ext()
Posted by Rafael J. Wysocki 1 month, 1 week ago
On Mon, Feb 23, 2026 at 4:46 PM Bartosz Golaszewski <brgl@kernel.org> wrote:
>
> On Mon, Feb 23, 2026 at 4:41 PM Bartosz Golaszewski
> <bartosz.golaszewski@oss.qualcomm.com> wrote:
> >
> > In GPIOLIB, during fwnode lookup, after having resolved the consumer's
> > reference to a specific fwnode, we only match it against the primary
> > node of the controllers. Let's extend that to also the secondary node by
> > exposing fwnode_is_primary() to drivers and reworking
> > gpio_chip_match_by_fwnode().
> >
> > Link: https://lore.kernel.org/all/aZUIFiOYt6GOlDQx@google.com/
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> > ---
>
> Forgot to pick up Linus' R-b:
>
> Reviewed-by: Linus Walleij <linusw@kernel.org>
>
> Rafael: is it fine if I take it through the GPIO tree?

Sure, no problem.