All of lore.kernel.org
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH] i2c: core: Use of_property_present() for wakeup-source
Date: Tue,  5 May 2026 11:31:45 +0700	[thread overview]
Message-ID: <20260505043145.33284-1-phucduc.bui@gmail.com> (raw)

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


                 reply	other threads:[~2026-05-05  4:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260505043145.33284-1-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.