lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z9vTV7tS2ZI3tM6m@mva-rohm>
Date: Thu, 20 Mar 2025 10:35:35 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Matti Vaittinen <mazziesaccount@...il.com>,
	Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Paul Elder <paul.elder@...asonboard.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] media: i2c: thp7312: Don't require node availability

It appears that the concept of available firmware nodes is not really
applicable to the scenarios where a specific name is required from a
node.

As explained[1] by Sakari:
"OF only enumerates available nodes via the fwnode API, software nodes
don't have the concept but on ACPI I guess you could have a difference
in nodes where you have device sub-nodes that aren't available. Still,
these ACPI device nodes don't have meaningful names in this context
(they're 4-character object names) so you wouldn't use them like this
anyway."

Use the fwnode_for_each_child_node() instead of the
fwnode_for_each_available_child_node() In order to make it clearly
visible that the 'availability' of the nodes does not need to be
considered here. This will make it clearly visible that the code in
this driver is suitable candidate to be converted to use the new
fwnode_for_each_named_child_node()[2] when it gets merged.

[1]:
https://lore.kernel.org/all/Z9rhfJUlCbi7kA2m@kekkonen.localdomain/
[2]:
https://lore.kernel.org/all/9c3880f74476436f39d796b5c10c540ae50b722c.1742225817.git.mazziesaccount@gmail.com/

Suggested-by: Sakari Ailus <sakari.ailus@...ux.intel.com>
Signed-off-by: Matti Vaittinen <mazziesaccount@...il.com>

---
NOTE: The change is compile tested only! Proper testing and reviewing is
highly appreciated (as always).

---
 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 8852c56431fe..4b66f64f8d65 100644
--- a/drivers/media/i2c/thp7312.c
+++ b/drivers/media/i2c/thp7312.c
@@ -2067,7 +2067,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++;

base-commit: 7eb172143d5508b4da468ed59ee857c6e5e01da6
-- 
2.48.1


Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ