From: Rob Herring <robh@kernel.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: devicetree@vger.kernel.org, sparclinux@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] sbus: display7seg: Use of_property_read_bool() for boolean properties
Date: Fri, 10 Mar 2023 08:47:22 -0600 [thread overview]
Message-ID: <20230310144723.1544930-1-robh@kernel.org> (raw)
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/sbus/char/display7seg.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index d93595b39afa..8bee31f03126 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -31,8 +31,8 @@ static int sol_compat = 0; /* Solaris compatibility mode */
/* Solaris compatibility flag -
* The Solaris implementation omits support for several
- * documented driver features (ref Sun doc 806-0180-03).
- * By default, this module supports the documented driver
+ * documented driver features (ref Sun doc 806-0180-03).
+ * By default, this module supports the documented driver
* abilities, rather than the Solaris implementation:
*
* 1) Device ALWAYS reverts to OBP-specified FLIPPED mode
@@ -44,7 +44,7 @@ static int sol_compat = 0; /* Solaris compatibility mode */
* omitting above features, set this parameter to non-zero.
*/
module_param(sol_compat, int, 0);
-MODULE_PARM_DESC(sol_compat,
+MODULE_PARM_DESC(sol_compat,
"Disables documented functionality omitted from Solaris driver");
MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
@@ -63,7 +63,7 @@ struct d7s *d7s_device;
* | DP | ALARM | FLIP | 4 | 3 | 2 | 1 | 0 |
* -----------------------------------------
*
- * DP - Toggles decimal point on/off
+ * DP - Toggles decimal point on/off
* ALARM - Toggles "Alarm" LED green/red
* FLIP - Inverts display for upside-down mounted board
* bits 0-4 - 7-segment display contents
@@ -200,9 +200,8 @@ static int d7s_probe(struct platform_device *op)
*/
regs = readb(p->regs);
opts = of_find_node_by_path("/options");
- if (opts &&
- of_get_property(opts, "d7s-flipped?", NULL))
- p->flipped = true;
+ if (opts)
+ p->flipped = of_property_read_bool(opts, "d7s-flipped?");
if (p->flipped)
regs |= D7S_FLIP;
--
2.39.2
reply other threads:[~2023-03-10 15:01 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=20230310144723.1544930-1-robh@kernel.org \
--to=robh@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.kernel.org \
/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).