* [PATCH] sbus: display7seg: Use of_property_read_bool() for boolean properties
@ 2023-03-10 14:47 Rob Herring
0 siblings, 0 replies; only message in thread
From: Rob Herring @ 2023-03-10 14:47 UTC (permalink / raw)
To: David S. Miller; +Cc: devicetree, sparclinux, linux-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-10 15:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10 14:47 [PATCH] sbus: display7seg: Use of_property_read_bool() for boolean properties Rob Herring
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).