Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v2 08/16] property: Document that fwnode API returns available nodes
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
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

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

* [PATCH v2 11/16] Input: touch-overlay - Use fwnode_for_each_child_node() instead
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
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

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

* [PATCH v2 13/16] leds: Use fwnode_for_each_child_node() instead
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
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

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

* [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead
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
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

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

* [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
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
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

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

* [PATCH v2 15/16] property: Drop functions operating on "available" child nodes
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
In-Reply-To: <20250924074602.266292-1-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
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
In-Reply-To: <20250924074602.266292-17-sakari.ailus@linux.intel.com>

[-- 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

* Re: Touchpad multitouch leaves ghost fingers
From: Benjamin Tissoires @ 2025-09-24  8:44 UTC (permalink / raw)
  To: Yinon Burgansky; +Cc: jikos, linux-input, linux-kernel
In-Reply-To: <CAEU-x4k_56w17y0DOKG2TRtegGvzVKS9USAERMa1MtO+3wZivA@mail.gmail.com>

On Sep 24 2025, Yinon Burgansky wrote:
> On Tue, Sep 23, 2025 at 7:30 PM Benjamin Tissoires <bentiss@kernel.org> wrote:
> > Got something out with https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/204
> > that seems to solve your case on the hid-recorder you provided.
> 
> Thank you so much!
> The install command didn't work properly for me:
> ```
> $ ./install.sh "*DLL0945*"
> $ tree /usr/local/lib/firmware
> /usr/local/lib/firmware
> └── hid
>     └── bpf
>         └── 0011-Synaptics__DLL0945.bpf.o
> $ reboot
> $ sudo tree /sys/fs/bpf
> /sys/fs/bpf
> 0 directories, 0 files
> ```

oops, yes, my bad. I forgot to put the correct group on the device
(multitouch_win_8 instead of generic). I've force pushed a new version,
so please redownload and reinstall it.


> I tried to add it manually and it seems to work now :)
> ```
> $ sudo udev-hid-bpf add /sys/bus/hid/devices/0018:06CB:CE26.0005
> /usr/local/lib/firmware/hid/bpf/0011-Synaptics__DLL0945.bpf.o
> $ sudo tree /sys/fs/bpf
> /sys/fs/bpf
> └── hid
>     └── 0018_06CB_CE26_0005
>         └── 0011-Synaptics__DLL0945_bpf
>             └── synaptics_dll0945
> 
> 4 directories, 1 file
> ```
> But I have to do it manually every time.
> Not sure what's wrong, maybe the added udev rule:
> ```
> $ cat /etc/udev/rules.d/81-hid-bpf.rules
> ACTION!="add|remove|bind", GOTO="hid_bpf_end"
> SUBSYSTEM!="hid", GOTO="hid_bpf_end"
> 
> # We lookup the hwdb during bind to set the property, but we don't do
> anything else
> IMPORT{builtin}="hwdb --subsystem=hid --lookup-prefix=hid-bpf:"
> #ACTION=="add", ENV{.HID_BPF}=="1",
> RUN{program}+="@@BINDIR@@/udev-hid-bpf add $sys$devpath"
> #MARKER
> ACTION=="add", ENV{.HID_BPF}=="1",
> RUN{program}+="/usr/local/bin/udev-hid-bpf add $sys$devpath"
> #ACTION=="remove", ENV{.HID_BPF}=="1",
> RUN{program}+="@@BINDIR@@/udev-hid-bpf remove $sys$devpath"
> #MARKER
> ACTION=="remove", ENV{.HID_BPF}=="1",
> RUN{program}+="/usr/local/bin/udev-hid-bpf remove $sys$devpath"
> 
> LABEL="hid_bpf_end"
> ```

The udev rule is fine, the hwdb is not. If you look at
/etc/udev/hwdb.d/81-hid-bpf-testing.hwdb you'll see that it shows:

hid-bpf:hid:b0018g0001v000006CBp0000CE26
  HID_BPF_T_002=0011-Synaptics__DLL0945.bpf.o
  .HID_BPF=1

But if you run `cat /sys/bus/hid/devices/0018:06CB:CE26.*/modalias`
you'll see that you have something like:

hid:b0018g0004v000006CBp0000CE26

the 'g0004' is not correct and therefore the qutobinding doesn't work :(

> this is the udevadm info (after reboot, it is sometimes hidraw3
> sometimes hidraw4):
> ```
> $  udevadm info --query=all --name=/dev/hidraw4
> P: /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-DLL0945:00/0018:06CB:CE26.0005/hidraw/hidraw4
> M: hidraw4
> R: 4
> J: c242:4
> U: hidraw
> D: c 242:4
> N: hidraw4
> L: 0
> E: DEVPATH=/devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-1/i2c-DLL0945:00/0018:06CB:CE26.0005/hidraw/hidraw4
> E: DEVNAME=/dev/hidraw4
> E: MAJOR=242
> E: MINOR=4
> E: SUBSYSTEM=hidraw
> E: USEC_INITIALIZED=3980846
> E: ID_VENDOR_FROM_DATABASE=Dell Inc
> E: ID_PATH=pci-0000:00:15.1-platform-i2c_designware.1
> E: ID_PATH_TAG=pci-0000_00_15_1-platform-i2c_designware_1
> E: ID_FOR_SEAT=hidraw-pci-0000_00_15_1-platform-i2c_designware_1
> E: TAGS=:seat:
> E: CURRENT_TAGS=:seat:
> ```
> 
> Thank you for the quick fix, it seems to work great so far!

\o/.

Now I need to make the kernel patch. Ideally I'd like you to test it,
but worse case I can just replay the recording as it seems to be enough.

Cheers,
Benjamin

^ permalink raw reply

* Re: [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static
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
In-Reply-To: <20250924074602.266292-2-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 02/16] ACPI: property: Use ACPI functions in acpi_graph_get_next_endpoint() only
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
In-Reply-To: <20250924074602.266292-3-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 03/16] ACPI: property: Rework acpi_graph_get_next_endpoint()
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
In-Reply-To: <20250924074602.266292-4-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 01/16] ACPI: property: Make acpi_get_next_subnode() static
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
In-Reply-To: <20250924092750.GA28073@pendragon.ideasonboard.com>

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

* Re: [PATCH v2 04/16] ACPI: property: Return present device nodes only on fwnode interface
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
In-Reply-To: <20250924074602.266292-5-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 05/16] property: Move Return: section of fwnode_graph_get_endpoint_by_id() down
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
In-Reply-To: <20250924074602.266292-6-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 06/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_by_id()
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
In-Reply-To: <20250924074602.266292-7-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 07/16] property: Drop DEVICE_DISABLED flag in fwnode_graph_get_endpoint_count()
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
In-Reply-To: <20250924074602.266292-8-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 09/16] driver core: Use fwnode_for_each_child_node() instead
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
In-Reply-To: <20250924074602.266292-10-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 10/16] net: lan966x: Use fwnode_for_each_child_node() instead
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
In-Reply-To: <20250924074602.266292-11-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 11/16] Input: touch-overlay - Use fwnode_for_each_child_node() instead
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
In-Reply-To: <20250924074602.266292-12-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 12/16] media: thp7312: Use fwnode_for_each_child_node() instead
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
In-Reply-To: <20250924074602.266292-13-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 13/16] leds: Use fwnode_for_each_child_node() instead
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
In-Reply-To: <20250924074602.266292-14-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 14/16] leds: Use fwnode_get_next_child_node() instead
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
In-Reply-To: <20250924074602.266292-15-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 15/16] property: Drop functions operating on "available" child nodes
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
In-Reply-To: <20250924074602.266292-16-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 16/16] spi: cadence: Remove explicit device node availability check
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
In-Reply-To: <20250924074602.266292-17-sakari.ailus@linux.intel.com>

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

* Re: [PATCH v2 08/16] property: Document that fwnode API returns available nodes
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
In-Reply-To: <20250924074602.266292-9-sakari.ailus@linux.intel.com>

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


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox