i2c: core: Use of_property_present() for wakeup-source
Subsystems (2)
PATCH 1/1 i2c: core: Use of_property_present() for wakeup-source
From: bui duc phuc <[email protected]>
The code currently uses of_property_read_bool() to check for the presence of the 'wakeup-source' property.
However, of_property_read_bool() is intended for boolean properties, and its usage on non-boolean types is deprecated. The 'wakeup-source' property may be defined either as a boolean or as a phandle-array, depending on the binding.
Switch to of_property_present() to check only for the presence of the property, avoiding any type assumptions about its type.
Also apply the same change to 'host-notify' for consistency.
Signed-off-by bui duc phuc <[email protected]>
---
Verified with st1232 touchscreen on Armadillo-800EVA (R8A7740).
drivers/i2c/i2c-core-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core-of.c +2 -2
@@ -51,10 +51,10 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node, info->addr = addr; info->fwnode =of_fwnode_handle (node); -if (of_property_read_bool (node,"host-notify" )) +if (of_property_present (node,"host-notify" )) info->flags |=I2C_CLIENT_HOST_NOTIFY ; -if (of_property_read_bool (node,"wakeup-source" )) +if (of_property_present (node,"wakeup-source" )) info->flags |=I2C_CLIENT_WAKE ;return 0 ;
Signature · 1 line
2.43.0