Skip to contentSkip to conversation

soc: fsl/qe: Use of_get_child_by_name helper

PATCH In review Rob Herring 3 participants 3 messages Aug 29, 2018 – Aug 30, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: fsl/qe: Use of_get_child_by_name helper

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 <[email protected]>
Cc Li Yang <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
---
 drivers/soc/fsl/qe/qe.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/soc/fsl/qe/qe.c +1 -5
index 2ef6fc6487c1..612d9c551be5 100644
@@ -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? */
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw

From: Rob Herring <[email protected]>
date: 2018/8/30 4:04

Quoted 25 lines

To: Qiang Zhao <[email protected]>
Cc: linux-kernel at vger.kernel.org; Leo Li <[email protected]>; linuxppc-dev at lists.ozlabs.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH] soc: fsl/qe: Use of_get_child_by_name helper

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 <[email protected]>
Cc Li Yang <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org
---
 drivers/soc/fsl/qe/qe.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/soc/fsl/qe/qe.c index renamed from drivers/soc/fsl/qe/qe.c +0 -0

2ef6fc6487c1..612d9c551be5 100644

drivers/soc/fsl/qe/qe.c +0 -0
@@ -588,11 +588,7 @@ struct qe_firmware_info *qe_get_firmware_info(void)
 	}
 
 	/* Find the 'firmware' child node */

drivers/soc/fsl/qe/qe.c struct qe_firmware_info *qe_get_firmware_info(void)

Quoted 10 lines
drivers/soc/fsl/qe/qe.c +1 -6
-	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? */
--
#2 lore raw
Quoted 17 lines · Qiang Zhao

From: Rob Herring <[email protected]>
date: 2018/8/30 4:04

Quoted 13 lines

To: Qiang Zhao <[email protected]>
Cc: linux-kernel at vger.kernel.org; Leo Li <[email protected]>; linuxppc-dev at lists.ozlabs.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH] soc: fsl/qe: Use of_get_child_by_name helper

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 <[email protected]>
Cc Li Yang <[email protected]>
Cc linuxppc-dev at lists.ozlabs.org
Cc linux-arm-kernel at lists.infradead.org

Merged for next. Thanks.

Regards,
Leo