Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (vexpress) Use of_property_present()

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>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20240731191312.1710417-13-robh@kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Rob Herring (Arm) and committed by
Guenter Roeck
85f72ffe 90368fa3

+1 -1
+1 -1
drivers/hwmon/vexpress-hwmon.c
··· 72 72 struct device_attribute, attr); 73 73 74 74 if (dev_attr->show == vexpress_hwmon_label_show && 75 - !of_get_property(dev->of_node, "label", NULL)) 75 + !of_property_present(dev->of_node, "label")) 76 76 return 0; 77 77 78 78 return attr->mode;