summaryrefslogtreecommitdiff
path: root/drivers/char/rtc.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-12-05 13:50:19 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-19 10:26:31 +0100
commitf88fd666051b08eb3f3118e2dd8508bf0247af4c (patch)
tree9252559c67ade1b85b0b7bc19c03e44b67ddfe21 /drivers/char/rtc.c
parent15b3048aeed8bf8232156456c884ae94ed52d6cd (diff)
downloadlinux-f88fd666051b08eb3f3118e2dd8508bf0247af4c.tar.gz
char/rtc: Use of_node_name_eq for node name comparisons
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. The open coded iterating thru the child node names is converted to use for_each_child_of_node() instead. Cc: Arnd Bergmann <arnd@arndb.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/rtc.c')
-rw-r--r--drivers/char/rtc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 4948c8bda6b1..62b7c721c732 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -866,8 +866,8 @@ static int __init rtc_init(void)
#ifdef CONFIG_SPARC32
for_each_node_by_name(ebus_dp, "ebus") {
struct device_node *dp;
- for (dp = ebus_dp; dp; dp = dp->sibling) {
- if (!strcmp(dp->name, "rtc")) {
+ for_each_child_of_node(ebus_dp, dp) {
+ if (of_node_name_eq(dp, "rtc")) {
op = of_find_device_by_node(dp);
if (op) {
rtc_port = op->resource[0].start;