lkml.org 
[lkml]   [2026]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] i2c: core: Use of_property_present() for wakeup-source
Date
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

\
 
 \ /
  Last update: 2026-05-05 06:32    [W:0.037 / U:7.175 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog