Skip to contentSkip to conversation

iio: dac: mcp4725: Use of_property_present() for non-boolean properties

PATCH In review Rob Herring (Arm) 2 participants 2 messages Nov 4, 2024 – Nov 9, 2024 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: dac: mcp4725: Use of_property_present() for non-boolean properties

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

---
 drivers/iio/dac/mcp4725.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/mcp4725.c +1 -1
index 25bb1c0490af..1337fb02ccf5 100644
@@ -379,7 +379,7 @@ static int mcp4725_probe_dt(struct device *dev,
 			    struct mcp4725_platform_data *pdata)
 {
 	/* check if is the vref-supply defined */
-	pdata->use_vref = device_property_read_bool(dev, "vref-supply");
+	pdata->use_vref = device_property_present(dev, "vref-supply");
 	pdata->vref_buffered =
 		device_property_read_bool(dev, "microchip,vref-buffered");
 
Signature · 1 line
2.45.2
maintainer
#1 lore raw
Quoted 5 lines · On Mon, 4 Nov 2024 13:08:46 -0600 "Rob Herring (Arm)" <[email protected]> wrote:

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

Applied to the testing branch of iio.git. I'll rebase that on 6.13-rc1 once available and push out for linux-next to pick up.

thanks,

Jonathan

Quoted 17 lines
---
 drivers/iio/dac/mcp4725.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/mcp4725.c +1 -1
index 25bb1c0490af..1337fb02ccf5 100644
@@ -379,7 +379,7 @@ static int mcp4725_probe_dt(struct device *dev,
 			    struct mcp4725_platform_data *pdata)
 {
 	/* check if is the vref-supply defined */
-	pdata->use_vref = device_property_read_bool(dev, "vref-supply");
+	pdata->use_vref = device_property_present(dev, "vref-supply");
 	pdata->vref_buffered =
 		device_property_read_bool(dev, "microchip,vref-buffered");