linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/16] Align availability checks on fwnode child node enumeration
@ 2025-09-24  7:45 Sakari Ailus
  2025-09-24  7:45 ` [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static Sakari Ailus
                   ` (17 more replies)
  0 siblings, 18 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hello everyone,

Historically the fwnode property API has enumerated only available device
nodes on OF whereas on ACPI, also nodes that haven't been present in the
system have been provided. Both OF and ACPI have similar concepts of node
availbility, on OF it's the "status" property present on device nodes and
on ACPI the _STA object evaluates to device present, enabled and
functional bits, of which the present and functional bits are currently
being used to determine whether to enumerate a device.

Two additional functions, fwnode_get_next_available_child_node() and
fwnode_for_each_available_child_node(), have been provided to enumerate
the available nodes only on ACPI, whereas on OF the implementation has
been the same on the non-available variants. The motivation for providing
these has very likely been to provide fwnode variants of the similarly
named functions but the difference isn't justifiable from API consistency
viewpoint.

This set switches the users away from the "available" fwnode API functions
and later on removes them, aligning the functionality on all fwnode
backends.

since v1:

- Move patch "ACPI: property: Make acpi_get_next_subnode() static" as
  first.

- Add missing parentheses and kernel-doc Return: section in
  acpi_get_next_present_subnode() documentation and move the Return
  section: of fwnode_graph_get_endpoint_by_id() to the end of the
  documentation section (new patch for the latter).

- Use device_get_next_child_node() instead of fwnode_get_next_child_node()
  in flash LED driver drivers.

- Rework iterating port nodes in acpi_graph_get_next_endpoint() as
  suggested by Andy (new patch).

Sakari Ailus (16):
  ACPI: property: Make acpi_get_next_subnode() static
  ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint()
    only
  ACPI: property: Rework acpi_graph_get_next_endpoint()
  ACPI: property: Return present device nodes only on fwnode interface
  property: Move Return: section of fwnode_graph_get_endpoint_by_id()
    down
  property: Drop DEVICE_DISABLED flag in
    fwnode_graph_get_endpoint_by_id()
  property: Drop DEVICE_DISABLED flag in
    fwnode_graph_get_endpoint_count()
  property: Document that fwnode API returns available nodes
  driver core: Use fwnode_for_each_child_node() instead
  net: lan966x: Use fwnode_for_each_child_node() instead
  Input: touch-overlay - Use fwnode_for_each_child_node() instead
  media: thp7312: Use fwnode_for_each_child_node() instead
  leds: Use fwnode_for_each_child_node() instead
  leds: Use fwnode_get_next_child_node() instead
  property: Drop functions operating on "available" child nodes
  spi: cadence: Remove explicit device node availability check

 drivers/acpi/property.c                       | 42 +++++++++----
 drivers/base/core.c                           | 10 ++--
 drivers/base/property.c                       | 60 ++++---------------
 drivers/input/touch-overlay.c                 |  2 +-
 drivers/leds/flash/leds-rt4505.c              |  2 +-
 drivers/leds/flash/leds-rt8515.c              |  2 +-
 drivers/leds/flash/leds-sgm3140.c             |  3 +-
 drivers/leds/flash/leds-tps6131x.c            |  2 +-
 drivers/leds/leds-max5970.c                   |  2 +-
 drivers/leds/leds-max77705.c                  |  2 +-
 drivers/leds/rgb/leds-ktd202x.c               |  4 +-
 drivers/leds/rgb/leds-ncp5623.c               |  2 +-
 drivers/media/i2c/thp7312.c                   |  2 +-
 .../ethernet/microchip/lan966x/lan966x_main.c |  2 +-
 drivers/spi/spi-cadence-xspi.c                |  3 -
 include/linux/acpi.h                          | 10 ----
 include/linux/property.h                      | 14 +----
 17 files changed, 61 insertions(+), 103 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 58+ messages in thread

* [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24  9:27   ` Laurent Pinchart
  2025-09-29  9:10   ` Jonathan Cameron
  2025-09-24  7:45 ` [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only Sakari Ailus
                   ` (16 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

acpi_get_next_subnode() is only used in drivers/acpi/property.c. Remove
its prototype from include/linux/acpi.h and make it static.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/property.c |  5 +++--
 include/linux/acpi.h    | 10 ----------
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 436019d96027..5435628c67e7 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1264,8 +1264,9 @@ static int stop_on_next(struct acpi_device *adev, void *data)
  * @fwnode: Firmware node to find the next child node for.
  * @child: Handle to one of the device's child nodes or a null handle.
  */
-struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
-					    struct fwnode_handle *child)
+static struct fwnode_handle *
+acpi_get_next_subnode(const struct fwnode_handle *fwnode,
+		      struct fwnode_handle *child)
 {
 	struct acpi_device *adev = to_acpi_device_node(fwnode);
 
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 5ff5d99f6ead..703323b9fe0c 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1349,9 +1349,6 @@ acpi_data_add_props(struct acpi_device_data *data, const guid_t *guid,
 int acpi_node_prop_get(const struct fwnode_handle *fwnode, const char *propname,
 		       void **valptr);
 
-struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
-					    struct fwnode_handle *child);
-
 struct acpi_probe_entry;
 typedef bool (*acpi_probe_entry_validate_subtbl)(struct acpi_subtable_header *,
 						 struct acpi_probe_entry *);
@@ -1450,13 +1447,6 @@ static inline int acpi_node_prop_get(const struct fwnode_handle *fwnode,
 	return -ENXIO;
 }
 
-static inline struct fwnode_handle *
-acpi_get_next_subnode(const struct fwnode_handle *fwnode,
-		      struct fwnode_handle *child)
-{
-	return NULL;
-}
-
 static inline struct fwnode_handle *
 acpi_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
 			     struct fwnode_handle *prev)
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
  2025-09-24  7:45 ` [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24  9:29   ` Laurent Pinchart
                     ` (2 more replies)
  2025-09-24  7:45 ` [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint() Sakari Ailus
                   ` (15 subsequent siblings)
  17 siblings, 3 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
property API is somewhat problematic as the latter is used in the
impelementation of the former. Instead of using
fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
acpi_get_next_subnode() directly instead.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/acpi/property.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 5435628c67e7..3e85900080ac 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1381,7 +1381,7 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
 
 	if (!prev) {
 		do {
-			port = fwnode_get_next_child_node(fwnode, port);
+			port = acpi_get_next_subnode(fwnode, port);
 			/*
 			 * The names of the port nodes begin with "port@"
 			 * followed by the number of the port node and they also
@@ -1399,13 +1399,13 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
 	if (!port)
 		return NULL;
 
-	endpoint = fwnode_get_next_child_node(port, prev);
+	endpoint = acpi_get_next_subnode(port, prev);
 	while (!endpoint) {
-		port = fwnode_get_next_child_node(fwnode, port);
+		port = acpi_get_next_subnode(fwnode, port);
 		if (!port)
 			break;
 		if (is_acpi_graph_node(port, "port"))
-			endpoint = fwnode_get_next_child_node(port, NULL);
+			endpoint = acpi_get_next_subnode(port, NULL);
 	}
 
 	/*
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint()
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
  2025-09-24  7:45 ` [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static Sakari Ailus
  2025-09-24  7:45 ` [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24  9:39   ` Laurent Pinchart
  2025-09-24  7:45 ` [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface Sakari Ailus
                   ` (14 subsequent siblings)
  17 siblings, 1 reply; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Rework the code obtaining the next endpoint in
acpi_graph_get_next_endpoint(). The resulting code removes unnecessary
contitionals and should be easier to follow.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/acpi/property.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 3e85900080ac..5438592dc136 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1399,14 +1399,15 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
 	if (!port)
 		return NULL;
 
-	endpoint = acpi_get_next_subnode(port, prev);
-	while (!endpoint) {
-		port = acpi_get_next_subnode(fwnode, port);
-		if (!port)
+	do {
+		endpoint = acpi_get_next_subnode(port, prev);
+		if (endpoint)
 			break;
+
+		port = acpi_get_next_subnode(fwnode, port);
 		if (is_acpi_graph_node(port, "port"))
-			endpoint = acpi_get_next_subnode(port, NULL);
-	}
+			prev = NULL;
+	} while (port);
 
 	/*
 	 * The names of the endpoint nodes begin with "endpoint@" followed by
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (2 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint() Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24  9:57   ` Laurent Pinchart
  2025-09-29  9:35   ` Jonathan Cameron
  2025-09-24  7:45 ` [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down Sakari Ailus
                   ` (13 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_graph_get_next_subnode() may return fwnode backed by ACPI device
nodes and there has been no check these devices are present in the system,
unlike there has been on fwnode OF backend. In order to provide consistent
behaviour towards callers, add a check for device presence by introducing
a new function acpi_get_next_present_subnode(), used as the
get_next_child_node() fwnode operation that also checks device node
presence.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/acpi/property.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index 5438592dc136..01f3880ffcce 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1319,6 +1319,26 @@ acpi_get_next_subnode(const struct fwnode_handle *fwnode,
 	return NULL;
 }
 
+/**
+ * acpi_get_next_present_subnode - Return the next present child node handle for a fwnode
+ * @fwnode: Firmware node to find the next child node for.
+ * @child: Handle to one of the device's child nodes or a null handle.
+ * Like acpi_get_next_subnode(), but the device nodes returned by
+ * acpi_get_next_present_subnode() are guaranteed to be present.
+ * Returns: The next sub-node fwnode handle.
+ */
+static struct fwnode_handle *
+acpi_get_next_present_subnode(const struct fwnode_handle *fwnode,
+			      struct fwnode_handle *child)
+{
+	do {
+		child = acpi_get_next_subnode(fwnode, child);
+	} while (is_acpi_device_node(child) &&
+		 !acpi_device_is_present(to_acpi_device_node(child)));
+
+	return child;
+}
+
 /**
  * acpi_node_get_parent - Return parent fwnode of this fwnode
  * @fwnode: Firmware node whose parent to get
@@ -1664,7 +1684,7 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
 		.property_read_string_array =				\
 			acpi_fwnode_property_read_string_array,		\
 		.get_parent = acpi_node_get_parent,			\
-		.get_next_child_node = acpi_get_next_subnode,		\
+		.get_next_child_node = acpi_get_next_present_subnode,	\
 		.get_named_child_node = acpi_fwnode_get_named_child_node, \
 		.get_name = acpi_fwnode_get_name,			\
 		.get_name_prefix = acpi_fwnode_get_name_prefix,		\
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (3 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24  9:58   ` Laurent Pinchart
  2025-09-29  9:37   ` Jonathan Cameron
  2025-09-24  7:45 ` [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id() Sakari Ailus
                   ` (12 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Move Return: section of fwnode_graph_get_endpoint_by_id() down where it
habitually is located.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index f626d5bbe806..b52f7b3bbf84 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1235,15 +1235,15 @@ static bool fwnode_graph_remote_available(struct fwnode_handle *ep)
  * The caller is responsible for calling fwnode_handle_put() on the returned
  * fwnode pointer.
  *
- * Return: the fwnode handle of the local endpoint corresponding the port and
- * endpoint IDs or %NULL if not found.
- *
  * If FWNODE_GRAPH_ENDPOINT_NEXT is passed in @flags and the specified endpoint
  * has not been found, look for the closest endpoint ID greater than the
  * specified one and return the endpoint that corresponds to it, if present.
  *
  * Does not return endpoints that belong to disabled devices or endpoints that
  * are unconnected, unless FWNODE_GRAPH_DEVICE_DISABLED is passed in @flags.
+ *
+ * Return: the fwnode handle of the local endpoint corresponding the port and
+ * endpoint IDs or %NULL if not found.
  */
 struct fwnode_handle *
 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id()
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (4 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24  9:59   ` Laurent Pinchart
  2025-09-24  7:45 ` [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count() Sakari Ailus
                   ` (11 subsequent siblings)
  17 siblings, 1 reply; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

No caller uses FWNODE_GRAPH_DEVICE_DISABLED flag when calling
fwnode_graph_get_endpoint_by_id(). Drop support for the flag entirely and
remove it from the documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index b52f7b3bbf84..7fc3257f223d 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1239,9 +1239,6 @@ static bool fwnode_graph_remote_available(struct fwnode_handle *ep)
  * has not been found, look for the closest endpoint ID greater than the
  * specified one and return the endpoint that corresponds to it, if present.
  *
- * Does not return endpoints that belong to disabled devices or endpoints that
- * are unconnected, unless FWNODE_GRAPH_DEVICE_DISABLED is passed in @flags.
- *
  * Return: the fwnode handle of the local endpoint corresponding the port and
  * endpoint IDs or %NULL if not found.
  */
@@ -1252,13 +1249,12 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 	struct fwnode_handle *ep, *best_ep = NULL;
 	unsigned int best_ep_id = 0;
 	bool endpoint_next = flags & FWNODE_GRAPH_ENDPOINT_NEXT;
-	bool enabled_only = !(flags & FWNODE_GRAPH_DEVICE_DISABLED);
 
 	fwnode_graph_for_each_endpoint(fwnode, ep) {
 		struct fwnode_endpoint fwnode_ep = { 0 };
 		int ret;
 
-		if (enabled_only && !fwnode_graph_remote_available(ep))
+		if (!fwnode_graph_remote_available(ep))
 			continue;
 
 		ret = fwnode_graph_parse_endpoint(ep, &fwnode_ep);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count()
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (5 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id() Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24 10:00   ` Laurent Pinchart
  2025-09-24  7:45 ` [PATCH v2 08/16] property: Document that fwnode API returns available nodes Sakari Ailus
                   ` (10 subsequent siblings)
  17 siblings, 1 reply; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

FWNODE_GRAPH_DEVICE_DISABLED flag isn't used anywhere, drop the flag and
support for it in fwnode_graph_get_endpoint_count().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/property.c  | 10 ++--------
 include/linux/property.h |  8 +-------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 7fc3257f223d..4bd64e729431 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1291,21 +1291,15 @@ EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id);
 /**
  * fwnode_graph_get_endpoint_count - Count endpoints on a device node
  * @fwnode: The node related to a device
- * @flags: fwnode lookup flags
  * Count endpoints in a device node.
- *
- * If FWNODE_GRAPH_DEVICE_DISABLED flag is specified, also unconnected endpoints
- * and endpoints connected to disabled devices are counted.
  */
-unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
-					     unsigned long flags)
+unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode)
 {
 	struct fwnode_handle *ep;
 	unsigned int count = 0;
 
 	fwnode_graph_for_each_endpoint(fwnode, ep) {
-		if (flags & FWNODE_GRAPH_DEVICE_DISABLED ||
-		    fwnode_graph_remote_available(ep))
+		if (fwnode_graph_remote_available(ep))
 			count++;
 	}
 
diff --git a/include/linux/property.h b/include/linux/property.h
index d1e80b3c9918..8b8bbbe6b5b7 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -503,19 +503,13 @@ static inline bool fwnode_graph_is_endpoint(const struct fwnode_handle *fwnode)
  * @FWNODE_GRAPH_ENDPOINT_NEXT: In the case of no exact match, look for the
  *				closest endpoint ID greater than the specified
  *				one.
- * @FWNODE_GRAPH_DEVICE_DISABLED: That the device to which the remote
- *				  endpoint of the given endpoint belongs to,
- *				  may be disabled, or that the endpoint is not
- *				  connected.
  */
 #define FWNODE_GRAPH_ENDPOINT_NEXT	BIT(0)
-#define FWNODE_GRAPH_DEVICE_DISABLED	BIT(1)
 
 struct fwnode_handle *
 fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
 				u32 port, u32 endpoint, unsigned long flags);
-unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
-					     unsigned long flags);
+unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode);
 
 #define fwnode_graph_for_each_endpoint(fwnode, child)				\
 	for (child = fwnode_graph_get_next_endpoint(fwnode, NULL); child;	\
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 08/16] property: Document that fwnode API returns available nodes
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (6 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count() Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24 10:06   ` Laurent Pinchart
  2025-09-29  9:44   ` Jonathan Cameron
  2025-09-24  7:45 ` [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead Sakari Ailus
                   ` (9 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

The fwnode API has historically provided two functions to iterate over a
fwnode's child nodes, fwnode_get_next_child_node() and
fwnode_get_next_available_child_node() whereas all of the fwnode API has
always worked on available nodes, apart unavailable ACPI child device
nodes could have been returned by fwnode_get_next_child_node().

Now that the availability check has been added to ACPI side as well,
document that the functions in the fwnode API return available nodes.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/property.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index 4bd64e729431..ff440456af7b 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -785,7 +785,7 @@ struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_nth_parent);
 
 /**
- * fwnode_get_next_child_node - Return the next child node handle for a node
+ * fwnode_get_next_child_node - Return the next available child node handle
  * @fwnode: Firmware node to find the next child node for.
  * @child: Handle to one of the node's child nodes or a %NULL handle.
  *
@@ -830,7 +830,7 @@ fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node);
 
 /**
- * device_get_next_child_node - Return the next child node handle for a device
+ * device_get_next_child_node - Return the next available child node handle for a device
  * @dev: Device to find the next child node for.
  * @child: Handle to one of the device's child nodes or a %NULL handle.
  *
@@ -858,7 +858,7 @@ struct fwnode_handle *device_get_next_child_node(const struct device *dev,
 EXPORT_SYMBOL_GPL(device_get_next_child_node);
 
 /**
- * fwnode_get_named_child_node - Return first matching named child node handle
+ * fwnode_get_named_child_node - Return first available matching named child node handle
  * @fwnode: Firmware node to find the named child node for.
  * @childname: String to match child node name against.
  *
@@ -874,7 +874,7 @@ fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_named_child_node);
 
 /**
- * device_get_named_child_node - Return first matching named child node handle
+ * device_get_named_child_node - Return first available matching named child node handle for a device
  * @dev: Device to find the named child node for.
  * @childname: String to match child node name against.
  *
@@ -928,7 +928,7 @@ bool fwnode_device_is_available(const struct fwnode_handle *fwnode)
 EXPORT_SYMBOL_GPL(fwnode_device_is_available);
 
 /**
- * fwnode_get_child_node_count - return the number of child nodes for a given firmware node
+ * fwnode_get_child_node_count - Return the number of available child nodes for a given firmware node
  * @fwnode: Pointer to the parent firmware node
  *
  * Return: the number of child nodes for a given firmware node.
@@ -946,7 +946,7 @@ unsigned int fwnode_get_child_node_count(const struct fwnode_handle *fwnode)
 EXPORT_SYMBOL_GPL(fwnode_get_child_node_count);
 
 /**
- * fwnode_get_named_child_node_count - number of child nodes with given name
+ * fwnode_get_named_child_node_count - Return the number of available child nodes with given name
  * @fwnode: Node which child nodes are counted.
  * @name: String to match child node name against.
  *
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (7 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 08/16] property: Document that fwnode API returns available nodes Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24 10:01   ` Laurent Pinchart
  2025-09-29  9:47   ` Jonathan Cameron
  2025-09-24  7:45 ` [PATCH v2 10/16] net: lan966x: " Sakari Ailus
                   ` (8 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/base/core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index d22d6b23e758..4bffd347e2f9 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -185,7 +185,7 @@ void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
 	fwnode->flags |= FWNODE_FLAG_NOT_DEVICE;
 	fwnode_links_purge_consumers(fwnode);
 
-	fwnode_for_each_available_child_node(fwnode, child)
+	fwnode_for_each_child_node(fwnode, child)
 		fw_devlink_purge_absent_suppliers(child);
 }
 EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
@@ -231,7 +231,7 @@ static void __fw_devlink_pickup_dangling_consumers(struct fwnode_handle *fwnode,
 	fwnode->flags |= FWNODE_FLAG_NOT_DEVICE;
 	__fwnode_links_move_consumers(fwnode, new_sup);
 
-	fwnode_for_each_available_child_node(fwnode, child)
+	fwnode_for_each_child_node(fwnode, child)
 		__fw_devlink_pickup_dangling_consumers(child, new_sup);
 }
 
@@ -1318,7 +1318,7 @@ void device_links_driver_bound(struct device *dev)
 
 		guard(mutex)(&fwnode_link_lock);
 
-		fwnode_for_each_available_child_node(dev->fwnode, child)
+		fwnode_for_each_child_node(dev->fwnode, child)
 			__fw_devlink_pickup_dangling_consumers(child,
 							       dev->fwnode);
 		__fw_devlink_link_to_consumers(dev);
@@ -1736,7 +1736,7 @@ static void fw_devlink_parse_fwtree(struct fwnode_handle *fwnode)
 
 	fw_devlink_parse_fwnode(fwnode);
 
-	while ((child = fwnode_get_next_available_child_node(fwnode, child)))
+	while ((child = fwnode_get_next_child_node(fwnode, child)))
 		fw_devlink_parse_fwtree(child);
 }
 
@@ -2309,7 +2309,7 @@ static void __fw_devlink_link_to_suppliers(struct device *dev,
 	 * case where the supplier is added before the consumer's parent device
 	 * (@dev).
 	 */
-	while ((child = fwnode_get_next_available_child_node(fwnode, child)))
+	while ((child = fwnode_get_next_child_node(fwnode, child)))
 		__fw_devlink_link_to_suppliers(dev, child);
 }
 
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 10/16] net: lan966x: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (8 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
  2025-09-29  9:48   ` Jonathan Cameron
  2025-09-24  7:45 ` [PATCH v2 11/16] Input: touch-overlay - " Sakari Ailus
                   ` (7 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
index 7001584f1b7a..e8f9bf96a63b 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -1190,7 +1190,7 @@ static int lan966x_probe(struct platform_device *pdev)
 	lan966x_stats_init(lan966x);
 
 	/* go over the child nodes */
-	fwnode_for_each_available_child_node(ports, portnp) {
+	fwnode_for_each_child_node(ports, portnp) {
 		phy_interface_t phy_mode;
 		struct phy *serdes;
 		u32 p;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 11/16] Input: touch-overlay - Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (9 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 10/16] net: lan966x: " Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
                     ` (2 more replies)
  2025-09-24  7:45 ` [PATCH v2 12/16] media: thp7312: " Sakari Ailus
                   ` (6 subsequent siblings)
  17 siblings, 3 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/input/touch-overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touch-overlay.c b/drivers/input/touch-overlay.c
index b9fd82c4829d..7eaaaef1bd82 100644
--- a/drivers/input/touch-overlay.c
+++ b/drivers/input/touch-overlay.c
@@ -82,7 +82,7 @@ int touch_overlay_map(struct list_head *list, struct input_dev *input)
 	if (!overlay)
 		return 0;
 
-	fwnode_for_each_available_child_node(overlay, fw_segment) {
+	fwnode_for_each_child_node(overlay, fw_segment) {
 		segment = devm_kzalloc(dev, sizeof(*segment), GFP_KERNEL);
 		if (!segment) {
 			fwnode_handle_put(fw_segment);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 12/16] media: thp7312: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (10 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 11/16] Input: touch-overlay - " Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
                     ` (2 more replies)
  2025-09-24  7:45 ` [PATCH v2 13/16] leds: " Sakari Ailus
                   ` (5 subsequent siblings)
  17 siblings, 3 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/thp7312.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/thp7312.c b/drivers/media/i2c/thp7312.c
index 775cfba188d8..86208a47f472 100644
--- a/drivers/media/i2c/thp7312.c
+++ b/drivers/media/i2c/thp7312.c
@@ -2064,7 +2064,7 @@ static int thp7312_parse_dt(struct thp7312_device *thp7312)
 		return -EINVAL;
 	}
 
-	fwnode_for_each_available_child_node(sensors, node) {
+	fwnode_for_each_child_node(sensors, node) {
 		if (fwnode_name_eq(node, "sensor")) {
 			if (!thp7312_sensor_parse_dt(thp7312, node))
 				num_sensors++;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 13/16] leds: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (11 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 12/16] media: thp7312: " Sakari Ailus
@ 2025-09-24  7:45 ` Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
  2025-09-29  9:51   ` Jonathan Cameron
  2025-09-24  7:46 ` [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead Sakari Ailus
                   ` (4 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:45 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_for_each_child_node() is now the same as
fwnode_for_each_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/leds/leds-max5970.c     | 2 +-
 drivers/leds/leds-max77705.c    | 2 +-
 drivers/leds/rgb/leds-ktd202x.c | 4 ++--
 drivers/leds/rgb/leds-ncp5623.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/leds/leds-max5970.c b/drivers/leds/leds-max5970.c
index 285074c53b23..a1e91a06249c 100644
--- a/drivers/leds/leds-max5970.c
+++ b/drivers/leds/leds-max5970.c
@@ -60,7 +60,7 @@ static int max5970_led_probe(struct platform_device *pdev)
 	if (!led_node)
 		return -ENODEV;
 
-	fwnode_for_each_available_child_node(led_node, child) {
+	fwnode_for_each_child_node(led_node, child) {
 		u32 reg;
 
 		if (fwnode_property_read_u32(child, "reg", &reg))
diff --git a/drivers/leds/leds-max77705.c b/drivers/leds/leds-max77705.c
index b7403b3fcf5e..1e2054c1bf80 100644
--- a/drivers/leds/leds-max77705.c
+++ b/drivers/leds/leds-max77705.c
@@ -191,7 +191,7 @@ static int max77705_add_led(struct device *dev, struct regmap *regmap, struct fw
 		cdev->brightness_set_blocking = max77705_led_brightness_set_multi;
 		cdev->blink_set = max77705_rgb_blink;
 
-		fwnode_for_each_available_child_node(np, child) {
+		fwnode_for_each_child_node(np, child) {
 			ret = max77705_parse_subled(dev, child, &info[i]);
 			if (ret < 0)
 				return ret;
diff --git a/drivers/leds/rgb/leds-ktd202x.c b/drivers/leds/rgb/leds-ktd202x.c
index 04e62faa3a00..e4f0f25a5e45 100644
--- a/drivers/leds/rgb/leds-ktd202x.c
+++ b/drivers/leds/rgb/leds-ktd202x.c
@@ -391,7 +391,7 @@ static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct fwnode_handle *fwn
 	int i = 0;
 
 	num_channels = 0;
-	fwnode_for_each_available_child_node(fwnode, child)
+	fwnode_for_each_child_node(fwnode, child)
 		num_channels++;
 
 	if (!num_channels || num_channels > chip->num_leds)
@@ -401,7 +401,7 @@ static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct fwnode_handle *fwn
 	if (!info)
 		return -ENOMEM;
 
-	fwnode_for_each_available_child_node(fwnode, child) {
+	fwnode_for_each_child_node(fwnode, child) {
 		u32 mono_color;
 		u32 reg;
 		int ret;
diff --git a/drivers/leds/rgb/leds-ncp5623.c b/drivers/leds/rgb/leds-ncp5623.c
index 7c7d44623a9e..85d6be6fff2b 100644
--- a/drivers/leds/rgb/leds-ncp5623.c
+++ b/drivers/leds/rgb/leds-ncp5623.c
@@ -180,7 +180,7 @@ static int ncp5623_probe(struct i2c_client *client)
 		goto release_mc_node;
 	}
 
-	fwnode_for_each_available_child_node(mc_node, led_node) {
+	fwnode_for_each_child_node(mc_node, led_node) {
 		ret = fwnode_property_read_u32(led_node, "color", &color_index);
 		if (ret)
 			goto release_led_node;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (12 preceding siblings ...)
  2025-09-24  7:45 ` [PATCH v2 13/16] leds: " Sakari Ailus
@ 2025-09-24  7:46 ` Sakari Ailus
  2025-09-24 10:03   ` Laurent Pinchart
  2025-09-29  9:51   ` Jonathan Cameron
  2025-09-24  7:46 ` [PATCH v2 15/16] property: Drop functions operating on "available" child nodes Sakari Ailus
                   ` (3 subsequent siblings)
  17 siblings, 2 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:46 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_get_next_child_node() is now the same as
fwnode_get_next_available_child_node() on all backends (OF, ACPI and
swnode). In order to remove the available variants, switch the uses to
non-available variants (device_get_next_child_node() in this case).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/leds/flash/leds-rt4505.c   | 2 +-
 drivers/leds/flash/leds-rt8515.c   | 2 +-
 drivers/leds/flash/leds-sgm3140.c  | 3 +--
 drivers/leds/flash/leds-tps6131x.c | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/leds/flash/leds-rt4505.c b/drivers/leds/flash/leds-rt4505.c
index f16358b8dfc1..18fd5b7e528f 100644
--- a/drivers/leds/flash/leds-rt4505.c
+++ b/drivers/leds/flash/leds-rt4505.c
@@ -365,7 +365,7 @@ static int rt4505_probe(struct i2c_client *client)
 		return ret;
 	}
 
-	child = fwnode_get_next_available_child_node(client->dev.fwnode, NULL);
+	child = device_get_next_child_node(&client->dev, NULL);
 	if (!child) {
 		dev_err(priv->dev, "Failed to get child node\n");
 		return -EINVAL;
diff --git a/drivers/leds/flash/leds-rt8515.c b/drivers/leds/flash/leds-rt8515.c
index 6af0d2c7fc56..f6b439674c03 100644
--- a/drivers/leds/flash/leds-rt8515.c
+++ b/drivers/leds/flash/leds-rt8515.c
@@ -304,7 +304,7 @@ static int rt8515_probe(struct platform_device *pdev)
 		return dev_err_probe(dev, PTR_ERR(rt->enable_torch),
 				     "cannot get ENT (enable torch) GPIO\n");
 
-	child = fwnode_get_next_available_child_node(dev->fwnode, NULL);
+	child = device_get_next_child_node(dev, NULL);
 	if (!child) {
 		dev_err(dev,
 			"No fwnode child node found for connected LED.\n");
diff --git a/drivers/leds/flash/leds-sgm3140.c b/drivers/leds/flash/leds-sgm3140.c
index 3e83200675f2..dc6840357370 100644
--- a/drivers/leds/flash/leds-sgm3140.c
+++ b/drivers/leds/flash/leds-sgm3140.c
@@ -214,8 +214,7 @@ static int sgm3140_probe(struct platform_device *pdev)
 		return dev_err_probe(&pdev->dev, ret,
 				     "Failed to request regulator\n");
 
-	child_node = fwnode_get_next_available_child_node(pdev->dev.fwnode,
-							  NULL);
+	child_node = device_get_next_child_node(&pdev->dev, NULL);
 	if (!child_node) {
 		dev_err(&pdev->dev,
 			"No fwnode child node found for connected LED.\n");
diff --git a/drivers/leds/flash/leds-tps6131x.c b/drivers/leds/flash/leds-tps6131x.c
index 6f4d4fd55361..f0f1f2b77d5a 100644
--- a/drivers/leds/flash/leds-tps6131x.c
+++ b/drivers/leds/flash/leds-tps6131x.c
@@ -544,7 +544,7 @@ static int tps6131x_parse_node(struct tps6131x *tps6131x)
 
 	tps6131x->valley_current_limit = device_property_read_bool(dev, "ti,valley-current-limit");
 
-	tps6131x->led_node = fwnode_get_next_available_child_node(dev->fwnode, NULL);
+	tps6131x->led_node = device_get_next_child_node(dev, NULL);
 	if (!tps6131x->led_node) {
 		dev_err(dev, "Missing LED node\n");
 		return -EINVAL;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 15/16] property: Drop functions operating on "available" child nodes
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (13 preceding siblings ...)
  2025-09-24  7:46 ` [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead Sakari Ailus
@ 2025-09-24  7:46 ` Sakari Ailus
  2025-09-24 10:04   ` Laurent Pinchart
  2025-09-24  7:46 ` [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check Sakari Ailus
                   ` (2 subsequent siblings)
  17 siblings, 1 reply; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:46 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

fwnode_get_next_available_child_node() and later
fwnode_for_each_available_child_node() were introduced to mirror the OF
interface operating on OF nodes. Now that these two are functionally the
same as the variants without "_available" part, drop the "_available"
variants.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/base/property.c  | 30 +-----------------------------
 include/linux/property.h |  6 ------
 2 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index ff440456af7b..75c3283fb5ca 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -802,35 +802,7 @@ fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
 EXPORT_SYMBOL_GPL(fwnode_get_next_child_node);
 
 /**
- * fwnode_get_next_available_child_node - Return the next available child node handle for a node
- * @fwnode: Firmware node to find the next child node for.
- * @child: Handle to one of the node's child nodes or a %NULL handle.
- *
- * The caller is responsible for calling fwnode_handle_put() on the returned
- * fwnode pointer. Note that this function also puts a reference to @child
- * unconditionally.
- */
-struct fwnode_handle *
-fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
-				     struct fwnode_handle *child)
-{
-	struct fwnode_handle *next_child = child;
-
-	if (IS_ERR_OR_NULL(fwnode))
-		return NULL;
-
-	do {
-		next_child = fwnode_get_next_child_node(fwnode, next_child);
-		if (!next_child)
-			return NULL;
-	} while (!fwnode_device_is_available(next_child));
-
-	return next_child;
-}
-EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node);
-
-/**
- * device_get_next_child_node - Return the next available child node handle for a device
+ * device_get_next_child_node - Return the next available child node handle
  * @dev: Device to find the next child node for.
  * @child: Handle to one of the device's child nodes or a %NULL handle.
  *
diff --git a/include/linux/property.h b/include/linux/property.h
index 8b8bbbe6b5b7..da6202053862 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -161,8 +161,6 @@ struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
 					    unsigned int depth);
 struct fwnode_handle *fwnode_get_next_child_node(
 	const struct fwnode_handle *fwnode, struct fwnode_handle *child);
-struct fwnode_handle *fwnode_get_next_available_child_node(
-	const struct fwnode_handle *fwnode, struct fwnode_handle *child);
 
 #define fwnode_for_each_child_node(fwnode, child)			\
 	for (child = fwnode_get_next_child_node(fwnode, NULL); child;	\
@@ -172,10 +170,6 @@ struct fwnode_handle *fwnode_get_next_available_child_node(
 	fwnode_for_each_child_node(fwnode, child)			\
 		for_each_if(fwnode_name_eq(child, name))
 
-#define fwnode_for_each_available_child_node(fwnode, child)		       \
-	for (child = fwnode_get_next_available_child_node(fwnode, NULL); child;\
-	     child = fwnode_get_next_available_child_node(fwnode, child))
-
 struct fwnode_handle *device_get_next_child_node(const struct device *dev,
 						 struct fwnode_handle *child);
 
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (14 preceding siblings ...)
  2025-09-24  7:46 ` [PATCH v2 15/16] property: Drop functions operating on "available" child nodes Sakari Ailus
@ 2025-09-24  7:46 ` Sakari Ailus
  2025-09-24  8:38   ` Mark Brown
                     ` (2 more replies)
  2025-09-24 10:52 ` [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Rafael J. Wysocki
  2025-10-09 12:38 ` (subset) " Lee Jones
  17 siblings, 3 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-24  7:46 UTC (permalink / raw)
  To: linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Don't check the availability of child device nodes explicitly as this is
now embedded in device_for_each_child_node().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/spi/spi-cadence-xspi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
index 6dcba0e0ddaa..23e426ef9b9c 100644
--- a/drivers/spi/spi-cadence-xspi.c
+++ b/drivers/spi/spi-cadence-xspi.c
@@ -908,9 +908,6 @@ static int cdns_xspi_of_get_plat_data(struct platform_device *pdev)
 	unsigned int cs;
 
 	device_for_each_child_node(&pdev->dev, fwnode_child) {
-		if (!fwnode_device_is_available(fwnode_child))
-			continue;
-
 		if (fwnode_property_read_u32(fwnode_child, "reg", &cs)) {
 			dev_err(&pdev->dev, "Couldn't get memory chip select\n");
 			fwnode_handle_put(fwnode_child);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
  2025-09-24  7:46 ` [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check Sakari Ailus
@ 2025-09-24  8:38   ` Mark Brown
  2025-09-24 10:04   ` Laurent Pinchart
  2025-09-29  9:54   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Mark Brown @ 2025-09-24  8:38 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Thomas Gleixner, Ingo Molnar, Jonathan Cameron

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

On Wed, Sep 24, 2025 at 10:46:02AM +0300, Sakari Ailus wrote:

> Don't check the availability of child device nodes explicitly as this is
> now embedded in device_for_each_child_node().

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static
  2025-09-24  7:45 ` [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static Sakari Ailus
@ 2025-09-24  9:27   ` Laurent Pinchart
  2025-09-24  9:49     ` Laurent Pinchart
  2025-09-29  9:10   ` Jonathan Cameron
  1 sibling, 1 reply; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24  9:27 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Sakari,

Thank you for the patch.

On Wed, Sep 24, 2025 at 10:45:47AM +0300, Sakari Ailus wrote:
> acpi_get_next_subnode() is only used in drivers/acpi/property.c. Remove
> its prototype from include/linux/acpi.h and make it static.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/acpi/property.c |  5 +++--
>  include/linux/acpi.h    | 10 ----------
>  2 files changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 436019d96027..5435628c67e7 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1264,8 +1264,9 @@ static int stop_on_next(struct acpi_device *adev, void *data)
>   * @fwnode: Firmware node to find the next child node for.
>   * @child: Handle to one of the device's child nodes or a null handle.
>   */
> -struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> -					    struct fwnode_handle *child)
> +static struct fwnode_handle *
> +acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> +		      struct fwnode_handle *child)
>  {
>  	struct acpi_device *adev = to_acpi_device_node(fwnode);
>  
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 5ff5d99f6ead..703323b9fe0c 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -1349,9 +1349,6 @@ acpi_data_add_props(struct acpi_device_data *data, const guid_t *guid,
>  int acpi_node_prop_get(const struct fwnode_handle *fwnode, const char *propname,
>  		       void **valptr);
>  
> -struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> -					    struct fwnode_handle *child);
> -
>  struct acpi_probe_entry;
>  typedef bool (*acpi_probe_entry_validate_subtbl)(struct acpi_subtable_header *,
>  						 struct acpi_probe_entry *);
> @@ -1450,13 +1447,6 @@ static inline int acpi_node_prop_get(const struct fwnode_handle *fwnode,
>  	return -ENXIO;
>  }
>  
> -static inline struct fwnode_handle *
> -acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> -		      struct fwnode_handle *child)
> -{
> -	return NULL;
> -}
> -
>  static inline struct fwnode_handle *
>  acpi_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
>  			     struct fwnode_handle *prev)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
  2025-09-24  7:45 ` [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only Sakari Ailus
@ 2025-09-24  9:29   ` Laurent Pinchart
  2025-09-24 18:32   ` Dmitry Torokhov
  2025-09-29  9:11   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24  9:29 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:48AM +0300, Sakari Ailus wrote:
> Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
> property API is somewhat problematic as the latter is used in the
> impelementation of the former. Instead of using
> fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
> acpi_get_next_subnode() directly instead.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/acpi/property.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 5435628c67e7..3e85900080ac 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1381,7 +1381,7 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
>  
>  	if (!prev) {
>  		do {
> -			port = fwnode_get_next_child_node(fwnode, port);
> +			port = acpi_get_next_subnode(fwnode, port);
>  			/*
>  			 * The names of the port nodes begin with "port@"
>  			 * followed by the number of the port node and they also
> @@ -1399,13 +1399,13 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
>  	if (!port)
>  		return NULL;
>  
> -	endpoint = fwnode_get_next_child_node(port, prev);
> +	endpoint = acpi_get_next_subnode(port, prev);
>  	while (!endpoint) {
> -		port = fwnode_get_next_child_node(fwnode, port);
> +		port = acpi_get_next_subnode(fwnode, port);
>  		if (!port)
>  			break;
>  		if (is_acpi_graph_node(port, "port"))
> -			endpoint = fwnode_get_next_child_node(port, NULL);
> +			endpoint = acpi_get_next_subnode(port, NULL);
>  	}
>  
>  	/*

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint()
  2025-09-24  7:45 ` [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint() Sakari Ailus
@ 2025-09-24  9:39   ` Laurent Pinchart
  2025-09-26 11:49     ` Sakari Ailus
  0 siblings, 1 reply; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24  9:39 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Sakari,

On Wed, Sep 24, 2025 at 10:45:49AM +0300, Sakari Ailus wrote:
> Rework the code obtaining the next endpoint in
> acpi_graph_get_next_endpoint(). The resulting code removes unnecessary
> contitionals and should be easier to follow.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/acpi/property.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 3e85900080ac..5438592dc136 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1399,14 +1399,15 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
>  	if (!port)
>  		return NULL;
>  
> -	endpoint = acpi_get_next_subnode(port, prev);
> -	while (!endpoint) {
> -		port = acpi_get_next_subnode(fwnode, port);
> -		if (!port)
> +	do {
> +		endpoint = acpi_get_next_subnode(port, prev);
> +		if (endpoint)
>  			break;
> +
> +		port = acpi_get_next_subnode(fwnode, port);
>  		if (is_acpi_graph_node(port, "port"))
> -			endpoint = acpi_get_next_subnode(port, NULL);
> -	}
> +			prev = NULL;

Isn't there an issue here ? If the next subnode of fwnode is not a port,
the next iteration of the do loop will attempt to get an endpoint from
that non-port node. Maybe the acpi_get_next_subnode() that will try to
get the endpoint from the non-port port will return NULL because prev
won't be a child of port, but that seems fragile.

I think the following would be easier to understand:

	do {
		endpoint = acpi_get_next_subnode(port, prev);
		if (endpoint)
			break;

		prev = NULL;

		do {
			port = acpi_get_next_subnode(fwnode, port);
		} while (port && !is_acpi_graph_node(port, "port"));
	} while (port);

> +	} while (port);
>  
>  	/*
>  	 * The names of the endpoint nodes begin with "endpoint@" followed by
> 

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static
  2025-09-24  9:27   ` Laurent Pinchart
@ 2025-09-24  9:49     ` Laurent Pinchart
  0 siblings, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24  9:49 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 12:27:53PM +0300, Laurent Pinchart wrote:
> Hi Sakari,
> 
> Thank you for the patch.
> 
> On Wed, Sep 24, 2025 at 10:45:47AM +0300, Sakari Ailus wrote:
> > acpi_get_next_subnode() is only used in drivers/acpi/property.c. Remove
> > its prototype from include/linux/acpi.h and make it static.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> > ---
> >  drivers/acpi/property.c |  5 +++--
> >  include/linux/acpi.h    | 10 ----------
> >  2 files changed, 3 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> > index 436019d96027..5435628c67e7 100644
> > --- a/drivers/acpi/property.c
> > +++ b/drivers/acpi/property.c
> > @@ -1264,8 +1264,9 @@ static int stop_on_next(struct acpi_device *adev, void *data)
> >   * @fwnode: Firmware node to find the next child node for.
> >   * @child: Handle to one of the device's child nodes or a null handle.
> >   */

I missed this, I'd turn /** into /* here as the function is now static.

> > -struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> > -					    struct fwnode_handle *child)
> > +static struct fwnode_handle *
> > +acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> > +		      struct fwnode_handle *child)
> >  {
> >  	struct acpi_device *adev = to_acpi_device_node(fwnode);
> >  
> > diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> > index 5ff5d99f6ead..703323b9fe0c 100644
> > --- a/include/linux/acpi.h
> > +++ b/include/linux/acpi.h
> > @@ -1349,9 +1349,6 @@ acpi_data_add_props(struct acpi_device_data *data, const guid_t *guid,
> >  int acpi_node_prop_get(const struct fwnode_handle *fwnode, const char *propname,
> >  		       void **valptr);
> >  
> > -struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> > -					    struct fwnode_handle *child);
> > -
> >  struct acpi_probe_entry;
> >  typedef bool (*acpi_probe_entry_validate_subtbl)(struct acpi_subtable_header *,
> >  						 struct acpi_probe_entry *);
> > @@ -1450,13 +1447,6 @@ static inline int acpi_node_prop_get(const struct fwnode_handle *fwnode,
> >  	return -ENXIO;
> >  }
> >  
> > -static inline struct fwnode_handle *
> > -acpi_get_next_subnode(const struct fwnode_handle *fwnode,
> > -		      struct fwnode_handle *child)
> > -{
> > -	return NULL;
> > -}
> > -
> >  static inline struct fwnode_handle *
> >  acpi_graph_get_next_endpoint(const struct fwnode_handle *fwnode,
> >  			     struct fwnode_handle *prev)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface
  2025-09-24  7:45 ` [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface Sakari Ailus
@ 2025-09-24  9:57   ` Laurent Pinchart
  2025-09-29  9:35   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24  9:57 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:50AM +0300, Sakari Ailus wrote:
> fwnode_graph_get_next_subnode() may return fwnode backed by ACPI device
> nodes and there has been no check these devices are present in the system,
> unlike there has been on fwnode OF backend. In order to provide consistent
> behaviour towards callers, add a check for device presence by introducing
> a new function acpi_get_next_present_subnode(), used as the
> get_next_child_node() fwnode operation that also checks device node
> presence.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/acpi/property.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 5438592dc136..01f3880ffcce 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1319,6 +1319,26 @@ acpi_get_next_subnode(const struct fwnode_handle *fwnode,
>  	return NULL;
>  }
>  
> +/**

/*

as the function is static ?

> + * acpi_get_next_present_subnode - Return the next present child node handle for a fwnode
> + * @fwnode: Firmware node to find the next child node for.
> + * @child: Handle to one of the device's child nodes or a null handle.

A blank line here would be nice.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> + * Like acpi_get_next_subnode(), but the device nodes returned by
> + * acpi_get_next_present_subnode() are guaranteed to be present.
> + * Returns: The next sub-node fwnode handle.
> + */
> +static struct fwnode_handle *
> +acpi_get_next_present_subnode(const struct fwnode_handle *fwnode,
> +			      struct fwnode_handle *child)
> +{
> +	do {
> +		child = acpi_get_next_subnode(fwnode, child);
> +	} while (is_acpi_device_node(child) &&
> +		 !acpi_device_is_present(to_acpi_device_node(child)));
> +
> +	return child;
> +}
> +
>  /**
>   * acpi_node_get_parent - Return parent fwnode of this fwnode
>   * @fwnode: Firmware node whose parent to get
> @@ -1664,7 +1684,7 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
>  		.property_read_string_array =				\
>  			acpi_fwnode_property_read_string_array,		\
>  		.get_parent = acpi_node_get_parent,			\
> -		.get_next_child_node = acpi_get_next_subnode,		\
> +		.get_next_child_node = acpi_get_next_present_subnode,	\
>  		.get_named_child_node = acpi_fwnode_get_named_child_node, \
>  		.get_name = acpi_fwnode_get_name,			\
>  		.get_name_prefix = acpi_fwnode_get_name_prefix,		\

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down
  2025-09-24  7:45 ` [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down Sakari Ailus
@ 2025-09-24  9:58   ` Laurent Pinchart
  2025-09-29  9:37   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24  9:58 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:51AM +0300, Sakari Ailus wrote:
> Move Return: section of fwnode_graph_get_endpoint_by_id() down where it
> habitually is located.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/base/property.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index f626d5bbe806..b52f7b3bbf84 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -1235,15 +1235,15 @@ static bool fwnode_graph_remote_available(struct fwnode_handle *ep)
>   * The caller is responsible for calling fwnode_handle_put() on the returned
>   * fwnode pointer.
>   *
> - * Return: the fwnode handle of the local endpoint corresponding the port and
> - * endpoint IDs or %NULL if not found.
> - *
>   * If FWNODE_GRAPH_ENDPOINT_NEXT is passed in @flags and the specified endpoint
>   * has not been found, look for the closest endpoint ID greater than the
>   * specified one and return the endpoint that corresponds to it, if present.
>   *
>   * Does not return endpoints that belong to disabled devices or endpoints that
>   * are unconnected, unless FWNODE_GRAPH_DEVICE_DISABLED is passed in @flags.
> + *
> + * Return: the fwnode handle of the local endpoint corresponding the port and
> + * endpoint IDs or %NULL if not found.
>   */
>  struct fwnode_handle *
>  fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id()
  2025-09-24  7:45 ` [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id() Sakari Ailus
@ 2025-09-24  9:59   ` Laurent Pinchart
  0 siblings, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24  9:59 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Sakari,

Thank you for the patch.

On Wed, Sep 24, 2025 at 10:45:52AM +0300, Sakari Ailus wrote:
> No caller uses FWNODE_GRAPH_DEVICE_DISABLED flag when calling
> fwnode_graph_get_endpoint_by_id(). Drop support for the flag entirely and
> remove it from the documentation.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

You can squash this with 07/16.

> ---
>  drivers/base/property.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index b52f7b3bbf84..7fc3257f223d 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -1239,9 +1239,6 @@ static bool fwnode_graph_remote_available(struct fwnode_handle *ep)
>   * has not been found, look for the closest endpoint ID greater than the
>   * specified one and return the endpoint that corresponds to it, if present.
>   *
> - * Does not return endpoints that belong to disabled devices or endpoints that
> - * are unconnected, unless FWNODE_GRAPH_DEVICE_DISABLED is passed in @flags.
> - *
>   * Return: the fwnode handle of the local endpoint corresponding the port and
>   * endpoint IDs or %NULL if not found.
>   */
> @@ -1252,13 +1249,12 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
>  	struct fwnode_handle *ep, *best_ep = NULL;
>  	unsigned int best_ep_id = 0;
>  	bool endpoint_next = flags & FWNODE_GRAPH_ENDPOINT_NEXT;
> -	bool enabled_only = !(flags & FWNODE_GRAPH_DEVICE_DISABLED);
>  
>  	fwnode_graph_for_each_endpoint(fwnode, ep) {
>  		struct fwnode_endpoint fwnode_ep = { 0 };
>  		int ret;
>  
> -		if (enabled_only && !fwnode_graph_remote_available(ep))
> +		if (!fwnode_graph_remote_available(ep))
>  			continue;
>  
>  		ret = fwnode_graph_parse_endpoint(ep, &fwnode_ep);

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count()
  2025-09-24  7:45 ` [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count() Sakari Ailus
@ 2025-09-24 10:00   ` Laurent Pinchart
  2025-09-29  9:40     ` Jonathan Cameron
  0 siblings, 1 reply; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:00 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:53AM +0300, Sakari Ailus wrote:
> FWNODE_GRAPH_DEVICE_DISABLED flag isn't used anywhere, drop the flag and
> support for it in fwnode_graph_get_endpoint_count().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

With 06/16 squashed into this,

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/base/property.c  | 10 ++--------
>  include/linux/property.h |  8 +-------
>  2 files changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index 7fc3257f223d..4bd64e729431 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -1291,21 +1291,15 @@ EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id);
>  /**
>   * fwnode_graph_get_endpoint_count - Count endpoints on a device node
>   * @fwnode: The node related to a device
> - * @flags: fwnode lookup flags
>   * Count endpoints in a device node.
> - *
> - * If FWNODE_GRAPH_DEVICE_DISABLED flag is specified, also unconnected endpoints
> - * and endpoints connected to disabled devices are counted.
>   */
> -unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
> -					     unsigned long flags)
> +unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode)
>  {
>  	struct fwnode_handle *ep;
>  	unsigned int count = 0;
>  
>  	fwnode_graph_for_each_endpoint(fwnode, ep) {
> -		if (flags & FWNODE_GRAPH_DEVICE_DISABLED ||
> -		    fwnode_graph_remote_available(ep))
> +		if (fwnode_graph_remote_available(ep))
>  			count++;
>  	}
>  
> diff --git a/include/linux/property.h b/include/linux/property.h
> index d1e80b3c9918..8b8bbbe6b5b7 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -503,19 +503,13 @@ static inline bool fwnode_graph_is_endpoint(const struct fwnode_handle *fwnode)
>   * @FWNODE_GRAPH_ENDPOINT_NEXT: In the case of no exact match, look for the
>   *				closest endpoint ID greater than the specified
>   *				one.
> - * @FWNODE_GRAPH_DEVICE_DISABLED: That the device to which the remote
> - *				  endpoint of the given endpoint belongs to,
> - *				  may be disabled, or that the endpoint is not
> - *				  connected.
>   */
>  #define FWNODE_GRAPH_ENDPOINT_NEXT	BIT(0)
> -#define FWNODE_GRAPH_DEVICE_DISABLED	BIT(1)
>  
>  struct fwnode_handle *
>  fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
>  				u32 port, u32 endpoint, unsigned long flags);
> -unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
> -					     unsigned long flags);
> +unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode);
>  
>  #define fwnode_graph_for_each_endpoint(fwnode, child)				\
>  	for (child = fwnode_graph_get_next_endpoint(fwnode, NULL); child;	\

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead Sakari Ailus
@ 2025-09-24 10:01   ` Laurent Pinchart
  2025-09-29  9:47   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:01 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:55AM +0300, Sakari Ailus wrote:
> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/base/core.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index d22d6b23e758..4bffd347e2f9 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -185,7 +185,7 @@ void fw_devlink_purge_absent_suppliers(struct fwnode_handle *fwnode)
>  	fwnode->flags |= FWNODE_FLAG_NOT_DEVICE;
>  	fwnode_links_purge_consumers(fwnode);
>  
> -	fwnode_for_each_available_child_node(fwnode, child)
> +	fwnode_for_each_child_node(fwnode, child)
>  		fw_devlink_purge_absent_suppliers(child);
>  }
>  EXPORT_SYMBOL_GPL(fw_devlink_purge_absent_suppliers);
> @@ -231,7 +231,7 @@ static void __fw_devlink_pickup_dangling_consumers(struct fwnode_handle *fwnode,
>  	fwnode->flags |= FWNODE_FLAG_NOT_DEVICE;
>  	__fwnode_links_move_consumers(fwnode, new_sup);
>  
> -	fwnode_for_each_available_child_node(fwnode, child)
> +	fwnode_for_each_child_node(fwnode, child)
>  		__fw_devlink_pickup_dangling_consumers(child, new_sup);
>  }
>  
> @@ -1318,7 +1318,7 @@ void device_links_driver_bound(struct device *dev)
>  
>  		guard(mutex)(&fwnode_link_lock);
>  
> -		fwnode_for_each_available_child_node(dev->fwnode, child)
> +		fwnode_for_each_child_node(dev->fwnode, child)
>  			__fw_devlink_pickup_dangling_consumers(child,
>  							       dev->fwnode);
>  		__fw_devlink_link_to_consumers(dev);
> @@ -1736,7 +1736,7 @@ static void fw_devlink_parse_fwtree(struct fwnode_handle *fwnode)
>  
>  	fw_devlink_parse_fwnode(fwnode);
>  
> -	while ((child = fwnode_get_next_available_child_node(fwnode, child)))
> +	while ((child = fwnode_get_next_child_node(fwnode, child)))
>  		fw_devlink_parse_fwtree(child);
>  }
>  
> @@ -2309,7 +2309,7 @@ static void __fw_devlink_link_to_suppliers(struct device *dev,
>  	 * case where the supplier is added before the consumer's parent device
>  	 * (@dev).
>  	 */
> -	while ((child = fwnode_get_next_available_child_node(fwnode, child)))
> +	while ((child = fwnode_get_next_child_node(fwnode, child)))
>  		__fw_devlink_link_to_suppliers(dev, child);
>  }
>  

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 10/16] net: lan966x: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 10/16] net: lan966x: " Sakari Ailus
@ 2025-09-24 10:02   ` Laurent Pinchart
  2025-09-29  9:48   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:02 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:56AM +0300, Sakari Ailus wrote:
> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> index 7001584f1b7a..e8f9bf96a63b 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> @@ -1190,7 +1190,7 @@ static int lan966x_probe(struct platform_device *pdev)
>  	lan966x_stats_init(lan966x);
>  
>  	/* go over the child nodes */
> -	fwnode_for_each_available_child_node(ports, portnp) {
> +	fwnode_for_each_child_node(ports, portnp) {
>  		phy_interface_t phy_mode;
>  		struct phy *serdes;
>  		u32 p;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 11/16] Input: touch-overlay - Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 11/16] Input: touch-overlay - " Sakari Ailus
@ 2025-09-24 10:02   ` Laurent Pinchart
  2025-09-24 18:36   ` Dmitry Torokhov
  2025-09-29  9:49   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:02 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:57AM +0300, Sakari Ailus wrote:
> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/input/touch-overlay.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touch-overlay.c b/drivers/input/touch-overlay.c
> index b9fd82c4829d..7eaaaef1bd82 100644
> --- a/drivers/input/touch-overlay.c
> +++ b/drivers/input/touch-overlay.c
> @@ -82,7 +82,7 @@ int touch_overlay_map(struct list_head *list, struct input_dev *input)
>  	if (!overlay)
>  		return 0;
>  
> -	fwnode_for_each_available_child_node(overlay, fw_segment) {
> +	fwnode_for_each_child_node(overlay, fw_segment) {
>  		segment = devm_kzalloc(dev, sizeof(*segment), GFP_KERNEL);
>  		if (!segment) {
>  			fwnode_handle_put(fw_segment);

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 12/16] media: thp7312: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 12/16] media: thp7312: " Sakari Ailus
@ 2025-09-24 10:02   ` Laurent Pinchart
  2025-09-25 10:40   ` Paul Elder
  2025-09-29  9:50   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:02 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:58AM +0300, Sakari Ailus wrote:
> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/media/i2c/thp7312.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/thp7312.c b/drivers/media/i2c/thp7312.c
> index 775cfba188d8..86208a47f472 100644
> --- a/drivers/media/i2c/thp7312.c
> +++ b/drivers/media/i2c/thp7312.c
> @@ -2064,7 +2064,7 @@ static int thp7312_parse_dt(struct thp7312_device *thp7312)
>  		return -EINVAL;
>  	}
>  
> -	fwnode_for_each_available_child_node(sensors, node) {
> +	fwnode_for_each_child_node(sensors, node) {
>  		if (fwnode_name_eq(node, "sensor")) {
>  			if (!thp7312_sensor_parse_dt(thp7312, node))
>  				num_sensors++;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 13/16] leds: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 13/16] leds: " Sakari Ailus
@ 2025-09-24 10:02   ` Laurent Pinchart
  2025-09-29  9:51   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:02 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:59AM +0300, Sakari Ailus wrote:
> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/leds/leds-max5970.c     | 2 +-
>  drivers/leds/leds-max77705.c    | 2 +-
>  drivers/leds/rgb/leds-ktd202x.c | 4 ++--
>  drivers/leds/rgb/leds-ncp5623.c | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/leds/leds-max5970.c b/drivers/leds/leds-max5970.c
> index 285074c53b23..a1e91a06249c 100644
> --- a/drivers/leds/leds-max5970.c
> +++ b/drivers/leds/leds-max5970.c
> @@ -60,7 +60,7 @@ static int max5970_led_probe(struct platform_device *pdev)
>  	if (!led_node)
>  		return -ENODEV;
>  
> -	fwnode_for_each_available_child_node(led_node, child) {
> +	fwnode_for_each_child_node(led_node, child) {
>  		u32 reg;
>  
>  		if (fwnode_property_read_u32(child, "reg", &reg))
> diff --git a/drivers/leds/leds-max77705.c b/drivers/leds/leds-max77705.c
> index b7403b3fcf5e..1e2054c1bf80 100644
> --- a/drivers/leds/leds-max77705.c
> +++ b/drivers/leds/leds-max77705.c
> @@ -191,7 +191,7 @@ static int max77705_add_led(struct device *dev, struct regmap *regmap, struct fw
>  		cdev->brightness_set_blocking = max77705_led_brightness_set_multi;
>  		cdev->blink_set = max77705_rgb_blink;
>  
> -		fwnode_for_each_available_child_node(np, child) {
> +		fwnode_for_each_child_node(np, child) {
>  			ret = max77705_parse_subled(dev, child, &info[i]);
>  			if (ret < 0)
>  				return ret;
> diff --git a/drivers/leds/rgb/leds-ktd202x.c b/drivers/leds/rgb/leds-ktd202x.c
> index 04e62faa3a00..e4f0f25a5e45 100644
> --- a/drivers/leds/rgb/leds-ktd202x.c
> +++ b/drivers/leds/rgb/leds-ktd202x.c
> @@ -391,7 +391,7 @@ static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct fwnode_handle *fwn
>  	int i = 0;
>  
>  	num_channels = 0;
> -	fwnode_for_each_available_child_node(fwnode, child)
> +	fwnode_for_each_child_node(fwnode, child)
>  		num_channels++;
>  
>  	if (!num_channels || num_channels > chip->num_leds)
> @@ -401,7 +401,7 @@ static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct fwnode_handle *fwn
>  	if (!info)
>  		return -ENOMEM;
>  
> -	fwnode_for_each_available_child_node(fwnode, child) {
> +	fwnode_for_each_child_node(fwnode, child) {
>  		u32 mono_color;
>  		u32 reg;
>  		int ret;
> diff --git a/drivers/leds/rgb/leds-ncp5623.c b/drivers/leds/rgb/leds-ncp5623.c
> index 7c7d44623a9e..85d6be6fff2b 100644
> --- a/drivers/leds/rgb/leds-ncp5623.c
> +++ b/drivers/leds/rgb/leds-ncp5623.c
> @@ -180,7 +180,7 @@ static int ncp5623_probe(struct i2c_client *client)
>  		goto release_mc_node;
>  	}
>  
> -	fwnode_for_each_available_child_node(mc_node, led_node) {
> +	fwnode_for_each_child_node(mc_node, led_node) {
>  		ret = fwnode_property_read_u32(led_node, "color", &color_index);
>  		if (ret)
>  			goto release_led_node;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead
  2025-09-24  7:46 ` [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead Sakari Ailus
@ 2025-09-24 10:03   ` Laurent Pinchart
  2025-09-29  9:51   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:03 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:46:00AM +0300, Sakari Ailus wrote:
> fwnode_get_next_child_node() is now the same as
> fwnode_get_next_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants (device_get_next_child_node() in this case).
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/leds/flash/leds-rt4505.c   | 2 +-
>  drivers/leds/flash/leds-rt8515.c   | 2 +-
>  drivers/leds/flash/leds-sgm3140.c  | 3 +--
>  drivers/leds/flash/leds-tps6131x.c | 2 +-
>  4 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/leds/flash/leds-rt4505.c b/drivers/leds/flash/leds-rt4505.c
> index f16358b8dfc1..18fd5b7e528f 100644
> --- a/drivers/leds/flash/leds-rt4505.c
> +++ b/drivers/leds/flash/leds-rt4505.c
> @@ -365,7 +365,7 @@ static int rt4505_probe(struct i2c_client *client)
>  		return ret;
>  	}
>  
> -	child = fwnode_get_next_available_child_node(client->dev.fwnode, NULL);
> +	child = device_get_next_child_node(&client->dev, NULL);
>  	if (!child) {
>  		dev_err(priv->dev, "Failed to get child node\n");
>  		return -EINVAL;
> diff --git a/drivers/leds/flash/leds-rt8515.c b/drivers/leds/flash/leds-rt8515.c
> index 6af0d2c7fc56..f6b439674c03 100644
> --- a/drivers/leds/flash/leds-rt8515.c
> +++ b/drivers/leds/flash/leds-rt8515.c
> @@ -304,7 +304,7 @@ static int rt8515_probe(struct platform_device *pdev)
>  		return dev_err_probe(dev, PTR_ERR(rt->enable_torch),
>  				     "cannot get ENT (enable torch) GPIO\n");
>  
> -	child = fwnode_get_next_available_child_node(dev->fwnode, NULL);
> +	child = device_get_next_child_node(dev, NULL);
>  	if (!child) {
>  		dev_err(dev,
>  			"No fwnode child node found for connected LED.\n");
> diff --git a/drivers/leds/flash/leds-sgm3140.c b/drivers/leds/flash/leds-sgm3140.c
> index 3e83200675f2..dc6840357370 100644
> --- a/drivers/leds/flash/leds-sgm3140.c
> +++ b/drivers/leds/flash/leds-sgm3140.c
> @@ -214,8 +214,7 @@ static int sgm3140_probe(struct platform_device *pdev)
>  		return dev_err_probe(&pdev->dev, ret,
>  				     "Failed to request regulator\n");
>  
> -	child_node = fwnode_get_next_available_child_node(pdev->dev.fwnode,
> -							  NULL);
> +	child_node = device_get_next_child_node(&pdev->dev, NULL);
>  	if (!child_node) {
>  		dev_err(&pdev->dev,
>  			"No fwnode child node found for connected LED.\n");
> diff --git a/drivers/leds/flash/leds-tps6131x.c b/drivers/leds/flash/leds-tps6131x.c
> index 6f4d4fd55361..f0f1f2b77d5a 100644
> --- a/drivers/leds/flash/leds-tps6131x.c
> +++ b/drivers/leds/flash/leds-tps6131x.c
> @@ -544,7 +544,7 @@ static int tps6131x_parse_node(struct tps6131x *tps6131x)
>  
>  	tps6131x->valley_current_limit = device_property_read_bool(dev, "ti,valley-current-limit");
>  
> -	tps6131x->led_node = fwnode_get_next_available_child_node(dev->fwnode, NULL);
> +	tps6131x->led_node = device_get_next_child_node(dev, NULL);
>  	if (!tps6131x->led_node) {
>  		dev_err(dev, "Missing LED node\n");
>  		return -EINVAL;

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 15/16] property: Drop functions operating on "available" child nodes
  2025-09-24  7:46 ` [PATCH v2 15/16] property: Drop functions operating on "available" child nodes Sakari Ailus
@ 2025-09-24 10:04   ` Laurent Pinchart
  2025-09-29  9:53     ` Jonathan Cameron
  0 siblings, 1 reply; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:04 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Sakari,

Thank you for the patch.

On Wed, Sep 24, 2025 at 10:46:01AM +0300, Sakari Ailus wrote:
> fwnode_get_next_available_child_node() and later
> fwnode_for_each_available_child_node() were introduced to mirror the OF
> interface operating on OF nodes. Now that these two are functionally the
> same as the variants without "_available" part, drop the "_available"
> variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  drivers/base/property.c  | 30 +-----------------------------
>  include/linux/property.h |  6 ------
>  2 files changed, 1 insertion(+), 35 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index ff440456af7b..75c3283fb5ca 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -802,35 +802,7 @@ fwnode_get_next_child_node(const struct fwnode_handle *fwnode,
>  EXPORT_SYMBOL_GPL(fwnode_get_next_child_node);
>  
>  /**
> - * fwnode_get_next_available_child_node - Return the next available child node handle for a node
> - * @fwnode: Firmware node to find the next child node for.
> - * @child: Handle to one of the node's child nodes or a %NULL handle.
> - *
> - * The caller is responsible for calling fwnode_handle_put() on the returned
> - * fwnode pointer. Note that this function also puts a reference to @child
> - * unconditionally.
> - */
> -struct fwnode_handle *
> -fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
> -				     struct fwnode_handle *child)
> -{
> -	struct fwnode_handle *next_child = child;
> -
> -	if (IS_ERR_OR_NULL(fwnode))
> -		return NULL;
> -
> -	do {
> -		next_child = fwnode_get_next_child_node(fwnode, next_child);
> -		if (!next_child)
> -			return NULL;
> -	} while (!fwnode_device_is_available(next_child));
> -
> -	return next_child;
> -}
> -EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node);
> -
> -/**
> - * device_get_next_child_node - Return the next available child node handle for a device
> + * device_get_next_child_node - Return the next available child node handle

This last line is an unrelated change. With that fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

>   * @dev: Device to find the next child node for.
>   * @child: Handle to one of the device's child nodes or a %NULL handle.
>   *
> diff --git a/include/linux/property.h b/include/linux/property.h
> index 8b8bbbe6b5b7..da6202053862 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -161,8 +161,6 @@ struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
>  					    unsigned int depth);
>  struct fwnode_handle *fwnode_get_next_child_node(
>  	const struct fwnode_handle *fwnode, struct fwnode_handle *child);
> -struct fwnode_handle *fwnode_get_next_available_child_node(
> -	const struct fwnode_handle *fwnode, struct fwnode_handle *child);
>  
>  #define fwnode_for_each_child_node(fwnode, child)			\
>  	for (child = fwnode_get_next_child_node(fwnode, NULL); child;	\
> @@ -172,10 +170,6 @@ struct fwnode_handle *fwnode_get_next_available_child_node(
>  	fwnode_for_each_child_node(fwnode, child)			\
>  		for_each_if(fwnode_name_eq(child, name))
>  
> -#define fwnode_for_each_available_child_node(fwnode, child)		       \
> -	for (child = fwnode_get_next_available_child_node(fwnode, NULL); child;\
> -	     child = fwnode_get_next_available_child_node(fwnode, child))
> -
>  struct fwnode_handle *device_get_next_child_node(const struct device *dev,
>  						 struct fwnode_handle *child);
>  

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
  2025-09-24  7:46 ` [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check Sakari Ailus
  2025-09-24  8:38   ` Mark Brown
@ 2025-09-24 10:04   ` Laurent Pinchart
  2025-09-29  9:54   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:04 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Sakari,

Thank you for the patch.

On Wed, Sep 24, 2025 at 10:46:02AM +0300, Sakari Ailus wrote:
> Don't check the availability of child device nodes explicitly as this is
> now embedded in device_for_each_child_node().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
>  drivers/spi/spi-cadence-xspi.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
> index 6dcba0e0ddaa..23e426ef9b9c 100644
> --- a/drivers/spi/spi-cadence-xspi.c
> +++ b/drivers/spi/spi-cadence-xspi.c
> @@ -908,9 +908,6 @@ static int cdns_xspi_of_get_plat_data(struct platform_device *pdev)
>  	unsigned int cs;
>  
>  	device_for_each_child_node(&pdev->dev, fwnode_child) {
> -		if (!fwnode_device_is_available(fwnode_child))
> -			continue;
> -
>  		if (fwnode_property_read_u32(fwnode_child, "reg", &cs)) {
>  			dev_err(&pdev->dev, "Couldn't get memory chip select\n");
>  			fwnode_handle_put(fwnode_child);

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 08/16] property: Document that fwnode API returns available nodes
  2025-09-24  7:45 ` [PATCH v2 08/16] property: Document that fwnode API returns available nodes Sakari Ailus
@ 2025-09-24 10:06   ` Laurent Pinchart
  2025-09-29  9:44   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Laurent Pinchart @ 2025-09-24 10:06 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Sakari,

On Wed, Sep 24, 2025 at 10:45:54AM +0300, Sakari Ailus wrote:
> The fwnode API has historically provided two functions to iterate over a
> fwnode's child nodes, fwnode_get_next_child_node() and
> fwnode_get_next_available_child_node() whereas all of the fwnode API has
> always worked on available nodes, apart unavailable ACPI child device
> nodes could have been returned by fwnode_get_next_child_node().
> 
> Now that the availability check has been added to ACPI side as well,
> document that the functions in the fwnode API return available nodes.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/base/property.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index 4bd64e729431..ff440456af7b 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -785,7 +785,7 @@ struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwnode,
>  EXPORT_SYMBOL_GPL(fwnode_get_nth_parent);
>  
>  /**
> - * fwnode_get_next_child_node - Return the next child node handle for a node
> + * fwnode_get_next_child_node - Return the next available child node handle
>   * @fwnode: Firmware node to find the next child node for.
>   * @child: Handle to one of the node's child nodes or a %NULL handle.
>   *
> @@ -830,7 +830,7 @@ fwnode_get_next_available_child_node(const struct fwnode_handle *fwnode,
>  EXPORT_SYMBOL_GPL(fwnode_get_next_available_child_node);
>  
>  /**
> - * device_get_next_child_node - Return the next child node handle for a device
> + * device_get_next_child_node - Return the next available child node handle for a device

You may want to drop "for a device" at the end of the line, it seems
you've made that change in 15/16 instead of here.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

>   * @dev: Device to find the next child node for.
>   * @child: Handle to one of the device's child nodes or a %NULL handle.
>   *
> @@ -858,7 +858,7 @@ struct fwnode_handle *device_get_next_child_node(const struct device *dev,
>  EXPORT_SYMBOL_GPL(device_get_next_child_node);
>  
>  /**
> - * fwnode_get_named_child_node - Return first matching named child node handle
> + * fwnode_get_named_child_node - Return first available matching named child node handle
>   * @fwnode: Firmware node to find the named child node for.
>   * @childname: String to match child node name against.
>   *
> @@ -874,7 +874,7 @@ fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
>  EXPORT_SYMBOL_GPL(fwnode_get_named_child_node);
>  
>  /**
> - * device_get_named_child_node - Return first matching named child node handle
> + * device_get_named_child_node - Return first available matching named child node handle for a device
>   * @dev: Device to find the named child node for.
>   * @childname: String to match child node name against.
>   *
> @@ -928,7 +928,7 @@ bool fwnode_device_is_available(const struct fwnode_handle *fwnode)
>  EXPORT_SYMBOL_GPL(fwnode_device_is_available);
>  
>  /**
> - * fwnode_get_child_node_count - return the number of child nodes for a given firmware node
> + * fwnode_get_child_node_count - Return the number of available child nodes for a given firmware node
>   * @fwnode: Pointer to the parent firmware node
>   *
>   * Return: the number of child nodes for a given firmware node.
> @@ -946,7 +946,7 @@ unsigned int fwnode_get_child_node_count(const struct fwnode_handle *fwnode)
>  EXPORT_SYMBOL_GPL(fwnode_get_child_node_count);
>  
>  /**
> - * fwnode_get_named_child_node_count - number of child nodes with given name
> + * fwnode_get_named_child_node_count - Return the number of available child nodes with given name
>   * @fwnode: Node which child nodes are counted.
>   * @name: String to match child node name against.
>   *

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 00/16] Align availability checks on fwnode child node enumeration
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (15 preceding siblings ...)
  2025-09-24  7:46 ` [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check Sakari Ailus
@ 2025-09-24 10:52 ` Rafael J. Wysocki
  2025-09-26 11:48   ` Sakari Ailus
  2025-10-09 12:38 ` (subset) " Lee Jones
  17 siblings, 1 reply; 58+ messages in thread
From: Rafael J. Wysocki @ 2025-09-24 10:52 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar,
	Jonathan Cameron

Hi Sakari,

On Wed, Sep 24, 2025 at 9:46 AM Sakari Ailus
<sakari.ailus@linux.intel.com> wrote:
>
> Hello everyone,
>
> Historically the fwnode property API has enumerated only available device
> nodes on OF whereas on ACPI, also nodes that haven't been present in the
> system have been provided. Both OF and ACPI have similar concepts of node
> availbility, on OF it's the "status" property present on device nodes and
> on ACPI the _STA object evaluates to device present, enabled and
> functional bits, of which the present and functional bits are currently
> being used to determine whether to enumerate a device.
>
> Two additional functions, fwnode_get_next_available_child_node() and
> fwnode_for_each_available_child_node(), have been provided to enumerate
> the available nodes only on ACPI, whereas on OF the implementation has
> been the same on the non-available variants. The motivation for providing
> these has very likely been to provide fwnode variants of the similarly
> named functions but the difference isn't justifiable from API consistency
> viewpoint.
>
> This set switches the users away from the "available" fwnode API functions
> and later on removes them, aligning the functionality on all fwnode
> backends.
>
> since v1:
>
> - Move patch "ACPI: property: Make acpi_get_next_subnode() static" as
>   first.
>
> - Add missing parentheses and kernel-doc Return: section in
>   acpi_get_next_present_subnode() documentation and move the Return
>   section: of fwnode_graph_get_endpoint_by_id() to the end of the
>   documentation section (new patch for the latter).
>
> - Use device_get_next_child_node() instead of fwnode_get_next_child_node()
>   in flash LED driver drivers.
>
> - Rework iterating port nodes in acpi_graph_get_next_endpoint() as
>   suggested by Andy (new patch).

I think that you really have four series here, or rather two series, a
collection of patches depending on them, and a follow-up cleanup.

> Sakari Ailus (16):
>   ACPI: property: Make acpi_get_next_subnode() static
>   ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint()
>     only
>   ACPI: property: Rework acpi_graph_get_next_endpoint()
>   ACPI: property: Return present device nodes only on fwnode interface

So the above is one series, focused on ACPI property changes.

They can go in via ACPI as soon as everyone is happy with them.  I
think I can push them for 6.18 if that helps to process the other
patches.

>   property: Move Return: section of fwnode_graph_get_endpoint_by_id()
>     down
>   property: Drop DEVICE_DISABLED flag in
>     fwnode_graph_get_endpoint_by_id()
>   property: Drop DEVICE_DISABLED flag in
>     fwnode_graph_get_endpoint_count()

The above patches are another series that doesn't depend on the first
one AFAICS and can go in via driver core.

>   property: Document that fwnode API returns available nodes
>   driver core: Use fwnode_for_each_child_node() instead
>   net: lan966x: Use fwnode_for_each_child_node() instead
>   Input: touch-overlay - Use fwnode_for_each_child_node() instead
>   media: thp7312: Use fwnode_for_each_child_node() instead
>   leds: Use fwnode_for_each_child_node() instead
>   leds: Use fwnode_get_next_child_node() instead

The above can go in via respective subsystem trees when the ACPI
property series gets in (I'm not sure if/how they depend on the second
series).

And the following one is a follow-up cleanup getting rid of code that
would be redundant going forward.

>   property: Drop functions operating on "available" child nodes
>   spi: cadence: Remove explicit device node availability check

Does the spi change depend on the previous patch?

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
  2025-09-24  7:45 ` [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only Sakari Ailus
  2025-09-24  9:29   ` Laurent Pinchart
@ 2025-09-24 18:32   ` Dmitry Torokhov
  2025-09-26  6:18     ` Sakari Ailus
  2025-09-29  9:11   ` Jonathan Cameron
  2 siblings, 1 reply; 58+ messages in thread
From: Dmitry Torokhov @ 2025-09-24 18:32 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Lee Jones,
	Pavel Machek, Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Sakari,

On Wed, Sep 24, 2025 at 10:45:48AM +0300, Sakari Ailus wrote:
> Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
> property API is somewhat problematic as the latter is used in the

How exactly is this problematic?

> impelementation of the former. Instead of using
> fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
> acpi_get_next_subnode() directly instead.

I think we are moving into the world of mixed fwnode types with software
nodes/secondary fwnodes, so I do not think this is a step in right
direction.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 11/16] Input: touch-overlay - Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 11/16] Input: touch-overlay - " Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
@ 2025-09-24 18:36   ` Dmitry Torokhov
  2025-09-29  9:49   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Dmitry Torokhov @ 2025-09-24 18:36 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Lee Jones,
	Pavel Machek, Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, Sep 24, 2025 at 10:45:57AM +0300, Sakari Ailus wrote:
> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/input/touch-overlay.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touch-overlay.c b/drivers/input/touch-overlay.c
> index b9fd82c4829d..7eaaaef1bd82 100644
> --- a/drivers/input/touch-overlay.c
> +++ b/drivers/input/touch-overlay.c
> @@ -82,7 +82,7 @@ int touch_overlay_map(struct list_head *list, struct input_dev *input)
>  	if (!overlay)
>  		return 0;
>  
> -	fwnode_for_each_available_child_node(overlay, fw_segment) {
> +	fwnode_for_each_child_node(overlay, fw_segment) {
>  		segment = devm_kzalloc(dev, sizeof(*segment), GFP_KERNEL);
>  		if (!segment) {
>  			fwnode_handle_put(fw_segment);

-- 
Dmitry

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 12/16] media: thp7312: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 12/16] media: thp7312: " Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
@ 2025-09-25 10:40   ` Paul Elder
  2025-09-29  9:50   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Paul Elder @ 2025-09-25 10:40 UTC (permalink / raw)
  To: Sakari Ailus, linux-acpi
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Mauro Carvalho Chehab, Horatiu Vultur,
	UNGLinuxDriver, Andrew Lunn, David S. Miller, Eric Dum azet,
	Jakub Kicinski, Paolo Abeni, Mark Brown, Thomas Gleixner,
	Ingo Molnar, Jonathan Cameron

Quoting Sakari Ailus (2025-09-24 16:45:58)
> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  drivers/media/i2c/thp7312.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/thp7312.c b/drivers/media/i2c/thp7312.c
> index 775cfba188d8..86208a47f472 100644
> --- a/drivers/media/i2c/thp7312.c
> +++ b/drivers/media/i2c/thp7312.c
> @@ -2064,7 +2064,7 @@ static int thp7312_parse_dt(struct thp7312_device *thp7312)
>                 return -EINVAL;
>         }
>  
> -       fwnode_for_each_available_child_node(sensors, node) {
> +       fwnode_for_each_child_node(sensors, node) {
>                 if (fwnode_name_eq(node, "sensor")) {
>                         if (!thp7312_sensor_parse_dt(thp7312, node))
>                                 num_sensors++;
> -- 
> 2.47.3
>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
  2025-09-24 18:32   ` Dmitry Torokhov
@ 2025-09-26  6:18     ` Sakari Ailus
  0 siblings, 0 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-26  6:18 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Lee Jones,
	Pavel Machek, Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Dmitry,

On Wed, Sep 24, 2025 at 11:32:56AM -0700, Dmitry Torokhov wrote:
> Hi Sakari,
> 
> On Wed, Sep 24, 2025 at 10:45:48AM +0300, Sakari Ailus wrote:
> > Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
> > property API is somewhat problematic as the latter is used in the
> 
> How exactly is this problematic?

In general, the fwnode property API is implemented by the (currently three)
backends so the backend calling fwnode property API to call itself without
knowing what exactly gets called may end up in an infinite recursion.
Keeping ACPI implementation separate from the fwnode property frontend
avoids even needing to think about this.

> 
> > impelementation of the former. Instead of using
> > fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
> > acpi_get_next_subnode() directly instead.
> 
> I think we are moving into the world of mixed fwnode types with software
> nodes/secondary fwnodes, so I do not think this is a step in right
> direction.

This is not how it works. If you have an ACPI node, it's and ACPI node, not
a software node or an OF node. A software node would be attached as
fwnode->secondary, it's not the same ACPI (device or data) node.

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 00/16] Align availability checks on fwnode child node enumeration
  2025-09-24 10:52 ` [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Rafael J. Wysocki
@ 2025-09-26 11:48   ` Sakari Ailus
  2025-09-26 12:52     ` Rafael J. Wysocki
  0 siblings, 1 reply; 58+ messages in thread
From: Sakari Ailus @ 2025-09-26 11:48 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Rafael,

On Wed, Sep 24, 2025 at 12:52:12PM +0200, Rafael J. Wysocki wrote:
> Hi Sakari,
> 
> On Wed, Sep 24, 2025 at 9:46 AM Sakari Ailus
> <sakari.ailus@linux.intel.com> wrote:
> >
> > Hello everyone,
> >
> > Historically the fwnode property API has enumerated only available device
> > nodes on OF whereas on ACPI, also nodes that haven't been present in the
> > system have been provided. Both OF and ACPI have similar concepts of node
> > availbility, on OF it's the "status" property present on device nodes and
> > on ACPI the _STA object evaluates to device present, enabled and
> > functional bits, of which the present and functional bits are currently
> > being used to determine whether to enumerate a device.
> >
> > Two additional functions, fwnode_get_next_available_child_node() and
> > fwnode_for_each_available_child_node(), have been provided to enumerate
> > the available nodes only on ACPI, whereas on OF the implementation has
> > been the same on the non-available variants. The motivation for providing
> > these has very likely been to provide fwnode variants of the similarly
> > named functions but the difference isn't justifiable from API consistency
> > viewpoint.
> >
> > This set switches the users away from the "available" fwnode API functions
> > and later on removes them, aligning the functionality on all fwnode
> > backends.
> >
> > since v1:
> >
> > - Move patch "ACPI: property: Make acpi_get_next_subnode() static" as
> >   first.
> >
> > - Add missing parentheses and kernel-doc Return: section in
> >   acpi_get_next_present_subnode() documentation and move the Return
> >   section: of fwnode_graph_get_endpoint_by_id() to the end of the
> >   documentation section (new patch for the latter).
> >
> > - Use device_get_next_child_node() instead of fwnode_get_next_child_node()
> >   in flash LED driver drivers.
> >
> > - Rework iterating port nodes in acpi_graph_get_next_endpoint() as
> >   suggested by Andy (new patch).
> 
> I think that you really have four series here, or rather two series, a
> collection of patches depending on them, and a follow-up cleanup.
> 
> > Sakari Ailus (16):
> >   ACPI: property: Make acpi_get_next_subnode() static
> >   ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint()
> >     only
> >   ACPI: property: Rework acpi_graph_get_next_endpoint()
> >   ACPI: property: Return present device nodes only on fwnode interface
> 
> So the above is one series, focused on ACPI property changes.
> 
> They can go in via ACPI as soon as everyone is happy with them.  I
> think I can push them for 6.18 if that helps to process the other
> patches.

If it's an option, that would be nice. But see below.

> 
> >   property: Move Return: section of fwnode_graph_get_endpoint_by_id()
> >     down
> >   property: Drop DEVICE_DISABLED flag in
> >     fwnode_graph_get_endpoint_by_id()
> >   property: Drop DEVICE_DISABLED flag in
> >     fwnode_graph_get_endpoint_count()
> 
> The above patches are another series that doesn't depend on the first
> one AFAICS and can go in via driver core.

Agreed.

> 
> >   property: Document that fwnode API returns available nodes
> >   driver core: Use fwnode_for_each_child_node() instead
> >   net: lan966x: Use fwnode_for_each_child_node() instead
> >   Input: touch-overlay - Use fwnode_for_each_child_node() instead
> >   media: thp7312: Use fwnode_for_each_child_node() instead
> >   leds: Use fwnode_for_each_child_node() instead
> >   leds: Use fwnode_get_next_child_node() instead
> 
> The above can go in via respective subsystem trees when the ACPI
> property series gets in (I'm not sure if/how they depend on the second
> series).
> 
> And the following one is a follow-up cleanup getting rid of code that
> would be redundant going forward.
> 
> >   property: Drop functions operating on "available" child nodes
> >   spi: cadence: Remove explicit device node availability check
> 
> Does the spi change depend on the previous patch?

There's really only one dependency, apart from the direct dependency of
fwnode_get_next_available_child_node() /
fwnode_for_each_available_child_node() definitions removed in the second
last patch: fwnode_get_next_child_node() and fwnode_for_each_child_node()
may still return non-available nodes before the last of the ACPI patches in
the set. So if the ACPI patches aren't merged but the rest are,
non-available nodes could be returned.

How about:

1. Merge the ACPI patches to 6.18.

2. Merge the rest, apart from the second last patch, for 6.19.

3. Once everything else is in, merge the last patch. Could wait for 6.20.

Perhaps I should split the series in three sets?

I'll send an update on the ACPI patches soon, to address a comment related
to them.

-- 
Kind regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint()
  2025-09-24  9:39   ` Laurent Pinchart
@ 2025-09-26 11:49     ` Sakari Ailus
  0 siblings, 0 replies; 58+ messages in thread
From: Sakari Ailus @ 2025-09-26 11:49 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

Hi Laurent,

Thank you for the review.

On Wed, Sep 24, 2025 at 12:39:34PM +0300, Laurent Pinchart wrote:
> Hi Sakari,
> 
> On Wed, Sep 24, 2025 at 10:45:49AM +0300, Sakari Ailus wrote:
> > Rework the code obtaining the next endpoint in
> > acpi_graph_get_next_endpoint(). The resulting code removes unnecessary
> > contitionals and should be easier to follow.
> > 
> > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> >  drivers/acpi/property.c | 13 +++++++------
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> > index 3e85900080ac..5438592dc136 100644
> > --- a/drivers/acpi/property.c
> > +++ b/drivers/acpi/property.c
> > @@ -1399,14 +1399,15 @@ static struct fwnode_handle *acpi_graph_get_next_endpoint(
> >  	if (!port)
> >  		return NULL;
> >  
> > -	endpoint = acpi_get_next_subnode(port, prev);
> > -	while (!endpoint) {
> > -		port = acpi_get_next_subnode(fwnode, port);
> > -		if (!port)
> > +	do {
> > +		endpoint = acpi_get_next_subnode(port, prev);
> > +		if (endpoint)
> >  			break;
> > +
> > +		port = acpi_get_next_subnode(fwnode, port);
> >  		if (is_acpi_graph_node(port, "port"))
> > -			endpoint = acpi_get_next_subnode(port, NULL);
> > -	}
> > +			prev = NULL;
> 
> Isn't there an issue here ? If the next subnode of fwnode is not a port,
> the next iteration of the do loop will attempt to get an endpoint from
> that non-port node. Maybe the acpi_get_next_subnode() that will try to
> get the endpoint from the non-port port will return NULL because prev
> won't be a child of port, but that seems fragile.
> 
> I think the following would be easier to understand:
> 
> 	do {
> 		endpoint = acpi_get_next_subnode(port, prev);
> 		if (endpoint)
> 			break;
> 
> 		prev = NULL;
> 
> 		do {
> 			port = acpi_get_next_subnode(fwnode, port);
> 		} while (port && !is_acpi_graph_node(port, "port"));
> 	} while (port);

Yes, this indeed ensures port will be a port node. I'll use this in the
next version.

> 
> > +	} while (port);
> >  
> >  	/*
> >  	 * The names of the endpoint nodes begin with "endpoint@" followed by
> > 
> 

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 00/16] Align availability checks on fwnode child node enumeration
  2025-09-26 11:48   ` Sakari Ailus
@ 2025-09-26 12:52     ` Rafael J. Wysocki
  0 siblings, 0 replies; 58+ messages in thread
From: Rafael J. Wysocki @ 2025-09-26 12:52 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Rafael J. Wysocki, linux-acpi, linux-kernel, linux-input,
	linux-leds, linux-media, netdev, linux-spi, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar,
	Jonathan Cameron

Hi Sakari,

On Fri, Sep 26, 2025 at 1:48 PM Sakari Ailus
<sakari.ailus@linux.intel.com> wrote:
>
> Hi Rafael,
>
> On Wed, Sep 24, 2025 at 12:52:12PM +0200, Rafael J. Wysocki wrote:
> > Hi Sakari,
> >
> > On Wed, Sep 24, 2025 at 9:46 AM Sakari Ailus
> > <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Hello everyone,
> > >
> > > Historically the fwnode property API has enumerated only available device
> > > nodes on OF whereas on ACPI, also nodes that haven't been present in the
> > > system have been provided. Both OF and ACPI have similar concepts of node
> > > availbility, on OF it's the "status" property present on device nodes and
> > > on ACPI the _STA object evaluates to device present, enabled and
> > > functional bits, of which the present and functional bits are currently
> > > being used to determine whether to enumerate a device.
> > >
> > > Two additional functions, fwnode_get_next_available_child_node() and
> > > fwnode_for_each_available_child_node(), have been provided to enumerate
> > > the available nodes only on ACPI, whereas on OF the implementation has
> > > been the same on the non-available variants. The motivation for providing
> > > these has very likely been to provide fwnode variants of the similarly
> > > named functions but the difference isn't justifiable from API consistency
> > > viewpoint.
> > >
> > > This set switches the users away from the "available" fwnode API functions
> > > and later on removes them, aligning the functionality on all fwnode
> > > backends.
> > >
> > > since v1:
> > >
> > > - Move patch "ACPI: property: Make acpi_get_next_subnode() static" as
> > >   first.
> > >
> > > - Add missing parentheses and kernel-doc Return: section in
> > >   acpi_get_next_present_subnode() documentation and move the Return
> > >   section: of fwnode_graph_get_endpoint_by_id() to the end of the
> > >   documentation section (new patch for the latter).
> > >
> > > - Use device_get_next_child_node() instead of fwnode_get_next_child_node()
> > >   in flash LED driver drivers.
> > >
> > > - Rework iterating port nodes in acpi_graph_get_next_endpoint() as
> > >   suggested by Andy (new patch).
> >
> > I think that you really have four series here, or rather two series, a
> > collection of patches depending on them, and a follow-up cleanup.
> >
> > > Sakari Ailus (16):
> > >   ACPI: property: Make acpi_get_next_subnode() static
> > >   ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint()
> > >     only
> > >   ACPI: property: Rework acpi_graph_get_next_endpoint()
> > >   ACPI: property: Return present device nodes only on fwnode interface
> >
> > So the above is one series, focused on ACPI property changes.
> >
> > They can go in via ACPI as soon as everyone is happy with them.  I
> > think I can push them for 6.18 if that helps to process the other
> > patches.
>
> If it's an option, that would be nice. But see below.
>
> >
> > >   property: Move Return: section of fwnode_graph_get_endpoint_by_id()
> > >     down
> > >   property: Drop DEVICE_DISABLED flag in
> > >     fwnode_graph_get_endpoint_by_id()
> > >   property: Drop DEVICE_DISABLED flag in
> > >     fwnode_graph_get_endpoint_count()
> >
> > The above patches are another series that doesn't depend on the first
> > one AFAICS and can go in via driver core.
>
> Agreed.
>
> >
> > >   property: Document that fwnode API returns available nodes
> > >   driver core: Use fwnode_for_each_child_node() instead
> > >   net: lan966x: Use fwnode_for_each_child_node() instead
> > >   Input: touch-overlay - Use fwnode_for_each_child_node() instead
> > >   media: thp7312: Use fwnode_for_each_child_node() instead
> > >   leds: Use fwnode_for_each_child_node() instead
> > >   leds: Use fwnode_get_next_child_node() instead
> >
> > The above can go in via respective subsystem trees when the ACPI
> > property series gets in (I'm not sure if/how they depend on the second
> > series).
> >
> > And the following one is a follow-up cleanup getting rid of code that
> > would be redundant going forward.
> >
> > >   property: Drop functions operating on "available" child nodes
> > >   spi: cadence: Remove explicit device node availability check
> >
> > Does the spi change depend on the previous patch?
>
> There's really only one dependency, apart from the direct dependency of
> fwnode_get_next_available_child_node() /
> fwnode_for_each_available_child_node() definitions removed in the second
> last patch: fwnode_get_next_child_node() and fwnode_for_each_child_node()
> may still return non-available nodes before the last of the ACPI patches in
> the set. So if the ACPI patches aren't merged but the rest are,
> non-available nodes could be returned.
>
> How about:
>
> 1. Merge the ACPI patches to 6.18.
>
> 2. Merge the rest, apart from the second last patch, for 6.19.
>
> 3. Once everything else is in, merge the last patch. Could wait for 6.20.

Sounds good.

> Perhaps I should split the series in three sets?

That would help I think.

> I'll send an update on the ACPI patches soon, to address a comment related
> to them.

OK

Thanks!

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static
  2025-09-24  7:45 ` [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static Sakari Ailus
  2025-09-24  9:27   ` Laurent Pinchart
@ 2025-09-29  9:10   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:10 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:47 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> acpi_get_next_subnode() is only used in drivers/acpi/property.c. Remove
> its prototype from include/linux/acpi.h and make it static.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
  2025-09-24  7:45 ` [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only Sakari Ailus
  2025-09-24  9:29   ` Laurent Pinchart
  2025-09-24 18:32   ` Dmitry Torokhov
@ 2025-09-29  9:11   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:11 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:48 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> Calling fwnode_get_next_child_node() in ACPI implementation of the fwnode
> property API is somewhat problematic as the latter is used in the
> impelementation of the former. Instead of using
> fwnode_get_next_child_node() in acpi_graph_get_next_endpoint(), call
> acpi_get_next_subnode() directly instead.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Makes sense to me on simply basis of making reasoning about it a little simpler.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface
  2025-09-24  7:45 ` [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface Sakari Ailus
  2025-09-24  9:57   ` Laurent Pinchart
@ 2025-09-29  9:35   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:35 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:50 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_graph_get_next_subnode() may return fwnode backed by ACPI device
> nodes and there has been no check these devices are present in the system,
> unlike there has been on fwnode OF backend. In order to provide consistent
> behaviour towards callers, add a check for device presence by introducing
> a new function acpi_get_next_present_subnode(), used as the
> get_next_child_node() fwnode operation that also checks device node
> presence.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

I think this is fine because of the bit in the ACPI spec that says all
bits are set if _STA is missing.   It seems much less likely we'll see
problems with hardware disappearing because _STA is there but says
the device isn't present.

Always a regression risk though :(

With the formatting changes Laurent asked for
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down
  2025-09-24  7:45 ` [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down Sakari Ailus
  2025-09-24  9:58   ` Laurent Pinchart
@ 2025-09-29  9:37   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:37 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:51 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> Move Return: section of fwnode_graph_get_endpoint_by_id() down where it
> habitually is located.

I was rather expecting the kernel-doc documentation to specify this but
it only seems to do so by example.  Hence reasonable to describe it as
you have.

> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count()
  2025-09-24 10:00   ` Laurent Pinchart
@ 2025-09-29  9:40     ` Jonathan Cameron
  0 siblings, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:40 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Sakari Ailus, linux-acpi, linux-kernel, linux-input, linux-leds,
	linux-media, netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 13:00:40 +0300
Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:

> On Wed, Sep 24, 2025 at 10:45:53AM +0300, Sakari Ailus wrote:
> > FWNODE_GRAPH_DEVICE_DISABLED flag isn't used anywhere, drop the flag and
> > support for it in fwnode_graph_get_endpoint_count().
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>  
> 
> With 06/16 squashed into this,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
Agreed, doing them together makes the flag disappear so we don't have
to check manually that there are indeed no uses of it with the functions you
modify in patch 6. 

With that,LGTM
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 08/16] property: Document that fwnode API returns available nodes
  2025-09-24  7:45 ` [PATCH v2 08/16] property: Document that fwnode API returns available nodes Sakari Ailus
  2025-09-24 10:06   ` Laurent Pinchart
@ 2025-09-29  9:44   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:44 UTC (permalink / raw)
  To: Sakari Ailus, Krzysztof Kozlowski
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:54 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> The fwnode API has historically provided two functions to iterate over a
> fwnode's child nodes, fwnode_get_next_child_node() and
> fwnode_get_next_available_child_node() whereas all of the fwnode API has
> always worked on available nodes, apart unavailable ACPI child device
> nodes could have been returned by fwnode_get_next_child_node().
> 
> Now that the availability check has been added to ACPI side as well,
> document that the functions in the fwnode API return available nodes.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead Sakari Ailus
  2025-09-24 10:01   ` Laurent Pinchart
@ 2025-09-29  9:47   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:47 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:55 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 10/16] net: lan966x: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 10/16] net: lan966x: " Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
@ 2025-09-29  9:48   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:48 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:56 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
FWIW given mechanical change
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 11/16] Input: touch-overlay - Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 11/16] Input: touch-overlay - " Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
  2025-09-24 18:36   ` Dmitry Torokhov
@ 2025-09-29  9:49   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:49 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:57 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Another mechanical change.
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

> ---
>  drivers/input/touch-overlay.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touch-overlay.c b/drivers/input/touch-overlay.c
> index b9fd82c4829d..7eaaaef1bd82 100644
> --- a/drivers/input/touch-overlay.c
> +++ b/drivers/input/touch-overlay.c
> @@ -82,7 +82,7 @@ int touch_overlay_map(struct list_head *list, struct input_dev *input)
>  	if (!overlay)
>  		return 0;
>  
> -	fwnode_for_each_available_child_node(overlay, fw_segment) {
> +	fwnode_for_each_child_node(overlay, fw_segment) {
>  		segment = devm_kzalloc(dev, sizeof(*segment), GFP_KERNEL);
>  		if (!segment) {
>  			fwnode_handle_put(fw_segment);


^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 12/16] media: thp7312: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 12/16] media: thp7312: " Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
  2025-09-25 10:40   ` Paul Elder
@ 2025-09-29  9:50   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:50 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:58 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 13/16] leds: Use fwnode_for_each_child_node() instead
  2025-09-24  7:45 ` [PATCH v2 13/16] leds: " Sakari Ailus
  2025-09-24 10:02   ` Laurent Pinchart
@ 2025-09-29  9:51   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:51 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:45:59 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_for_each_child_node() is now the same as
> fwnode_for_each_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead
  2025-09-24  7:46 ` [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead Sakari Ailus
  2025-09-24 10:03   ` Laurent Pinchart
@ 2025-09-29  9:51   ` Jonathan Cameron
  1 sibling, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:51 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:46:00 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> fwnode_get_next_child_node() is now the same as
> fwnode_get_next_available_child_node() on all backends (OF, ACPI and
> swnode). In order to remove the available variants, switch the uses to
> non-available variants (device_get_next_child_node() in this case).
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>



^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 15/16] property: Drop functions operating on "available" child nodes
  2025-09-24 10:04   ` Laurent Pinchart
@ 2025-09-29  9:53     ` Jonathan Cameron
  0 siblings, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:53 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Sakari Ailus, linux-acpi, linux-kernel, linux-input, linux-leds,
	linux-media, netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar


> > -/**
> > - * device_get_next_child_node - Return the next available child node handle for a device
> > + * device_get_next_child_node - Return the next available child node handle  
> 
> This last line is an unrelated change. With that fixed,
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

I'll assume you'll tidy that up.

Very pleased to see this go, simply for the saving in time explaining the odd difference
to people in driver reviews!

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
  2025-09-24  7:46 ` [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check Sakari Ailus
  2025-09-24  8:38   ` Mark Brown
  2025-09-24 10:04   ` Laurent Pinchart
@ 2025-09-29  9:54   ` Jonathan Cameron
  2 siblings, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2025-09-29  9:54 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: linux-acpi, linux-kernel, linux-input, linux-leds, linux-media,
	netdev, linux-spi, Rafael J. Wysocki, Len Brown,
	Greg Kroah-Hartman, Danilo Krummrich, Andy Shevchenko,
	Daniel Scally, Heikki Krogerus, Javier Carrasco, Dmitry Torokhov,
	Lee Jones, Pavel Machek, Matthias Fend, Chanwoo Choi,
	Krzysztof Kozlowski, Laurent Pinchart, Paul Elder,
	Mauro Carvalho Chehab, Horatiu Vultur, UNGLinuxDriver,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Mark Brown, Thomas Gleixner, Ingo Molnar

On Wed, 24 Sep 2025 10:46:02 +0300
Sakari Ailus <sakari.ailus@linux.intel.com> wrote:

> Don't check the availability of child device nodes explicitly as this is
> now embedded in device_for_each_child_node().
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

> ---
>  drivers/spi/spi-cadence-xspi.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-cadence-xspi.c b/drivers/spi/spi-cadence-xspi.c
> index 6dcba0e0ddaa..23e426ef9b9c 100644
> --- a/drivers/spi/spi-cadence-xspi.c
> +++ b/drivers/spi/spi-cadence-xspi.c
> @@ -908,9 +908,6 @@ static int cdns_xspi_of_get_plat_data(struct platform_device *pdev)
>  	unsigned int cs;
>  
>  	device_for_each_child_node(&pdev->dev, fwnode_child) {
> -		if (!fwnode_device_is_available(fwnode_child))
> -			continue;
> -
>  		if (fwnode_property_read_u32(fwnode_child, "reg", &cs)) {
>  			dev_err(&pdev->dev, "Couldn't get memory chip select\n");
>  			fwnode_handle_put(fwnode_child);


^ permalink raw reply	[flat|nested] 58+ messages in thread

* Re: (subset) [PATCH v2 00/16] Align availability checks on fwnode child node enumeration
  2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
                   ` (16 preceding siblings ...)
  2025-09-24 10:52 ` [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Rafael J. Wysocki
@ 2025-10-09 12:38 ` Lee Jones
  17 siblings, 0 replies; 58+ messages in thread
From: Lee Jones @ 2025-10-09 12:38 UTC (permalink / raw)
  To: linux-acpi, Sakari Ailus
  Cc: linux-kernel, linux-input, linux-leds, linux-media, netdev,
	linux-spi, Rafael J. Wysocki, Len Brown, Greg Kroah-Hartman,
	Danilo Krummrich, Andy Shevchenko, Daniel Scally, Heikki Krogerus,
	Javier Carrasco, Dmitry Torokhov, Lee Jones, Pavel Machek,
	Matthias Fend, Chanwoo Choi, Krzysztof Kozlowski,
	Laurent Pinchart, Paul Elder, Mauro Carvalho Chehab,
	Horatiu Vultur, UNGLinuxDriver, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mark Brown,
	Thomas Gleixner, Ingo Molnar, Jonathan Cameron

On Wed, 24 Sep 2025 10:45:46 +0300, Sakari Ailus wrote:
> Historically the fwnode property API has enumerated only available device
> nodes on OF whereas on ACPI, also nodes that haven't been present in the
> system have been provided. Both OF and ACPI have similar concepts of node
> availbility, on OF it's the "status" property present on device nodes and
> on ACPI the _STA object evaluates to device present, enabled and
> functional bits, of which the present and functional bits are currently
> being used to determine whether to enumerate a device.
> 
> [...]

Applied, thanks!

[13/16] leds: Use fwnode_for_each_child_node() instead
        commit: 34dbf5b458193b120a4a00777f2045f40c3db974
[14/16] leds: Use fwnode_get_next_child_node() instead
        commit: 93ecfb549059e3c77da16364c0f6fbddb42b147b

--
Lee Jones [李琼斯]


^ permalink raw reply	[flat|nested] 58+ messages in thread

end of thread, other threads:[~2025-10-09 12:39 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24  7:45 [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Sakari Ailus
2025-09-24  7:45 ` [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static Sakari Ailus
2025-09-24  9:27   ` Laurent Pinchart
2025-09-24  9:49     ` Laurent Pinchart
2025-09-29  9:10   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only Sakari Ailus
2025-09-24  9:29   ` Laurent Pinchart
2025-09-24 18:32   ` Dmitry Torokhov
2025-09-26  6:18     ` Sakari Ailus
2025-09-29  9:11   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint() Sakari Ailus
2025-09-24  9:39   ` Laurent Pinchart
2025-09-26 11:49     ` Sakari Ailus
2025-09-24  7:45 ` [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface Sakari Ailus
2025-09-24  9:57   ` Laurent Pinchart
2025-09-29  9:35   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down Sakari Ailus
2025-09-24  9:58   ` Laurent Pinchart
2025-09-29  9:37   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id() Sakari Ailus
2025-09-24  9:59   ` Laurent Pinchart
2025-09-24  7:45 ` [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count() Sakari Ailus
2025-09-24 10:00   ` Laurent Pinchart
2025-09-29  9:40     ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 08/16] property: Document that fwnode API returns available nodes Sakari Ailus
2025-09-24 10:06   ` Laurent Pinchart
2025-09-29  9:44   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead Sakari Ailus
2025-09-24 10:01   ` Laurent Pinchart
2025-09-29  9:47   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 10/16] net: lan966x: " Sakari Ailus
2025-09-24 10:02   ` Laurent Pinchart
2025-09-29  9:48   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 11/16] Input: touch-overlay - " Sakari Ailus
2025-09-24 10:02   ` Laurent Pinchart
2025-09-24 18:36   ` Dmitry Torokhov
2025-09-29  9:49   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 12/16] media: thp7312: " Sakari Ailus
2025-09-24 10:02   ` Laurent Pinchart
2025-09-25 10:40   ` Paul Elder
2025-09-29  9:50   ` Jonathan Cameron
2025-09-24  7:45 ` [PATCH v2 13/16] leds: " Sakari Ailus
2025-09-24 10:02   ` Laurent Pinchart
2025-09-29  9:51   ` Jonathan Cameron
2025-09-24  7:46 ` [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead Sakari Ailus
2025-09-24 10:03   ` Laurent Pinchart
2025-09-29  9:51   ` Jonathan Cameron
2025-09-24  7:46 ` [PATCH v2 15/16] property: Drop functions operating on "available" child nodes Sakari Ailus
2025-09-24 10:04   ` Laurent Pinchart
2025-09-29  9:53     ` Jonathan Cameron
2025-09-24  7:46 ` [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check Sakari Ailus
2025-09-24  8:38   ` Mark Brown
2025-09-24 10:04   ` Laurent Pinchart
2025-09-29  9:54   ` Jonathan Cameron
2025-09-24 10:52 ` [PATCH v2 00/16] Align availability checks on fwnode child node enumeration Rafael J. Wysocki
2025-09-26 11:48   ` Sakari Ailus
2025-09-26 12:52     ` Rafael J. Wysocki
2025-10-09 12:38 ` (subset) " Lee Jones

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).