summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/sunzilog.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 08:47:26 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-16 13:02:11 +0100
commitef194140308776be60dd4601bd01c00c84fb8b39 (patch)
treea035b982cabdd9dcb6265e8a6f78161b537c528e /drivers/tty/serial/sunzilog.c
parent571079f5ba93f08ac2563d40e46d42d56615c096 (diff)
serial: Use of_property_present() for testing DT property presence
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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20230310144727.1545630-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/sunzilog.c')
-rw-r--r--drivers/tty/serial/sunzilog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index ccb809216e94..0fbeb3dbd843 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -1403,7 +1403,7 @@ static int zs_probe(struct platform_device *op)
int keyboard_mouse = 0;
int err;
- if (of_find_property(op->dev.of_node, "keyboard", NULL))
+ if (of_property_present(op->dev.of_node, "keyboard"))
keyboard_mouse = 1;
/* uarts must come before keyboards/mice */
@@ -1553,7 +1553,7 @@ static int __init sunzilog_init(void)
for_each_node_by_name(dp, "zs") {
num_sunzilog++;
- if (of_find_property(dp, "keyboard", NULL))
+ if (of_property_present(dp, "keyboard"))
num_keybms++;
}