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

iio: adc: aspeed: Use of_property_present()

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

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Link: https://patch.msgid.link/20240731191312.1710417-5-robh@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Rob Herring (Arm) and committed by
Jonathan Cameron
958000df 72c80a93

+1 -2
+1 -2
drivers/iio/adc/aspeed_adc.c
··· 555 555 if (ret) 556 556 return ret; 557 557 558 - if (of_find_property(data->dev->of_node, "aspeed,battery-sensing", 559 - NULL)) { 558 + if (of_property_present(data->dev->of_node, "aspeed,battery-sensing")) { 560 559 if (data->model_data->bat_sense_sup) { 561 560 data->battery_sensing = 1; 562 561 if (readl(data->base + ASPEED_REG_ENGINE_CONTROL) &