The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] hwmon: vexpress: Use of_property_present()
@ 2024-07-31 19:12 Rob Herring (Arm)
  2024-07-31 19:19 ` Sudeep Holla
  2024-07-31 20:27 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring (Arm) @ 2024-07-31 19:12 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Liviu Dudau, Sudeep Holla,
	Lorenzo Pieralisi
  Cc: linux-hwmon, linux-arm-kernel, linux-kernel

Use of_property_present() to test for property presence rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 drivers/hwmon/vexpress-hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/vexpress-hwmon.c b/drivers/hwmon/vexpress-hwmon.c
index d82a3b454d0e..a2e350f52a9e 100644
--- a/drivers/hwmon/vexpress-hwmon.c
+++ b/drivers/hwmon/vexpress-hwmon.c
@@ -72,7 +72,7 @@ static umode_t vexpress_hwmon_attr_is_visible(struct kobject *kobj,
 				struct device_attribute, attr);
 
 	if (dev_attr->show == vexpress_hwmon_label_show &&
-			!of_get_property(dev->of_node, "label", NULL))
+			!of_property_present(dev->of_node, "label"))
 		return 0;
 
 	return attr->mode;
-- 
2.43.0


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

end of thread, other threads:[~2024-07-31 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 19:12 [PATCH] hwmon: vexpress: Use of_property_present() Rob Herring (Arm)
2024-07-31 19:19 ` Sudeep Holla
2024-07-31 20:27 ` Guenter Roeck

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