soc: fsl/qe: Use of_get_child_by_name helper
authorRob Herring <robh@kernel.org>
Wed, 29 Aug 2018 20:04:25 +0000 (15:04 -0500)
committerLi Yang <leoyang.li@nxp.com>
Thu, 30 Aug 2018 17:01:28 +0000 (12:01 -0500)
Use the of_get_child_by_name() helper instead of open coding searching
for the 'firmware' child node. This removes directly accessing the name
pointer as well.

Cc: Qiang Zhao <qiang.zhao@nxp.com>
Cc: Li Yang <leoyang.li@nxp.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Qiang Zhao <qiang.zhao@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
drivers/soc/fsl/qe/qe.c

index 2ef6fc6487c113f8cb33aade2fa4f3d1d30f5454..612d9c551be5de8ba27dea64f9fb30705964ed83 100644 (file)
@@ -588,11 +588,7 @@ struct qe_firmware_info *qe_get_firmware_info(void)
        }
 
        /* Find the 'firmware' child node */
-       for_each_child_of_node(qe, fw) {
-               if (strcmp(fw->name, "firmware") == 0)
-                       break;
-       }
-
+       fw = of_get_child_by_name(qe, "firmware");
        of_node_put(qe);
 
        /* Did we find the 'firmware' node? */