]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
char/rtc: Use of_node_name_eq for node name comparisons
authorRob Herring <robh@kernel.org>
Wed, 5 Dec 2018 19:50:19 +0000 (13:50 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Dec 2018 09:26:31 +0000 (10:26 +0100)
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>
drivers/char/rtc.c

index 4948c8bda6b1fb7d5dc1dd734f52ebc11307aa99..62b7c721c73230207c5f6c8d06e3c16fecb5489e 100644 (file)
@@ -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;