[PATCH v2 0/2] driver core: provide and use device_match_fwnode_ext()
From: Bartosz Golaszewski
Date: Mon Feb 23 2026 - 10:42:02 EST
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@xxxxxxxxxx/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxxx
---
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@xxxxxxxxxxxxxxxx>