mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 20:34:23 -04:00
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>
This commit is contained in:
committed by
Jonathan Cameron
parent
72c80a9320
commit
958000dfa3
@@ -555,8 +555,7 @@ static int aspeed_adc_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (of_find_property(data->dev->of_node, "aspeed,battery-sensing",
|
||||
NULL)) {
|
||||
if (of_property_present(data->dev->of_node, "aspeed,battery-sensing")) {
|
||||
if (data->model_data->bat_sense_sup) {
|
||||
data->battery_sensing = 1;
|
||||
if (readl(data->base + ASPEED_REG_ENGINE_CONTROL) &
|
||||
|
||||
Reference in New Issue
Block a user