* [PATCH] i2c: core: Use of_property_present() for wakeup-source
@ 2026-05-05 4:31 phucduc.bui
0 siblings, 0 replies; only message in thread
From: phucduc.bui @ 2026-05-05 4:31 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
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 <phucduc.bui@gmail.com>
---
Verified with st1232 touchscreen on Armadillo-800EVA (R8A7740).
drivers/i2c/i2c-core-of.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 354a88d0599e..b45d39da9208 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -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;
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-05 4:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 4:31 [PATCH] i2c: core: Use of_property_present() for wakeup-source phucduc.bui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox