From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Peter Rosin <peda@axentia.se>, Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Subject: [PATCH] i2c: mux: reg: use of_property_read_bool()
Date: Sun, 20 Aug 2017 22:06:50 +0300 [thread overview]
Message-ID: <20170820190656.846142358@cogentembedded.com> (raw)
[-- Attachment #1: i2c-mux-reg-use-of_property_read_bool.patch --]
[-- Type: text/plain, Size: 1486 bytes --]
Use more compact of_property_read_bool() calls for the boolean properties
instead of of_find_property() calls in i2c_mux_reg_probe_dt().
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
The patch is against Wolfram Sang's 'linux.git' repo's 'i2c/for-next' branch.
drivers/i2c/muxes/i2c-mux-reg.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: linux/drivers/i2c/muxes/i2c-mux-reg.c
===================================================================
--- linux.orig/drivers/i2c/muxes/i2c-mux-reg.c
+++ linux/drivers/i2c/muxes/i2c-mux-reg.c
@@ -107,9 +107,9 @@ static int i2c_mux_reg_probe_dt(struct r
put_device(&adapter->dev);
mux->data.n_values = of_get_child_count(np);
- if (of_find_property(np, "little-endian", NULL)) {
+ if (of_property_read_bool(np, "little-endian")) {
mux->data.little_endian = true;
- } else if (of_find_property(np, "big-endian", NULL)) {
+ } else if (of_property_read_bool(np, "big-endian")) {
mux->data.little_endian = false;
} else {
#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : \
@@ -122,10 +122,7 @@ static int i2c_mux_reg_probe_dt(struct r
#error Endianness not defined?
#endif
}
- if (of_find_property(np, "write-only", NULL))
- mux->data.write_only = true;
- else
- mux->data.write_only = false;
+ mux->data.write_only = of_property_read_bool(np, "write-only");
values = devm_kzalloc(&pdev->dev,
sizeof(*mux->data.values) * mux->data.n_values,
next reply other threads:[~2017-08-20 19:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-20 19:06 Sergei Shtylyov [this message]
2017-10-13 12:13 ` [PATCH] i2c: mux: reg: use of_property_read_bool() Sergei Shtylyov
2017-10-13 21:53 ` Peter Rosin
2017-10-20 15:40 ` Peter Rosin
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=20170820190656.846142358@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-i2c@vger.kernel.org \
--cc=peda@axentia.se \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).