[PATCH] soc: fsl/qe: Use of_get_child_by_name helper

Subsystems: freescale quicc engine library, freescale soc drivers, the rest

STALE2899d

3 messages, 3 authors, 2018-08-30 · open the first message on its own page

[PATCH] soc: fsl/qe: Use of_get_child_by_name helper

From: Rob Herring <robh@kernel.org>
Date: 2018-08-29 20:04:30

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 <redacted>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/soc/fsl/qe/qe.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c
index 2ef6fc6487c1..612d9c551be5 100644
--- a/drivers/soc/fsl/qe/qe.c
+++ b/drivers/soc/fsl/qe/qe.c
@@ -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? */
-- 
2.17.1

RE: [PATCH] soc: fsl/qe: Use of_get_child_by_name helper

From: Qiang Zhao <qiang.zhao@nxp.com>
Date: 2018-08-30 02:47:39

From: Rob Herring <robh@kernel.org>
date: 2018/8/30 4:04
To: Qiang Zhao <qiang.zhao@nxp.com>
Cc: linux-kernel@vger.kernel.org; Leo Li <redacted>;
linuxppc-dev@lists.ozlabs.org; linux-arm-kernel@lists.infradead.org
Subject: [PATCH] soc: fsl/qe: Use of_get_child_by_name helper
=20
Use the of_get_child_by_name() helper instead of open coding searching fo=
r the
'firmware' child node. This removes directly accessing the name pointer a=
s well.
quoted hunk
=20
Cc: Qiang Zhao <qiang.zhao@nxp.com>
Cc: Li Yang <redacted>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/soc/fsl/qe/qe.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
=20
diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index
2ef6fc6487c1..612d9c551be5 100644
--- a/drivers/soc/fsl/qe/qe.c
+++ b/drivers/soc/fsl/qe/qe.c
@@ -588,11 +588,7 @@ struct qe_firmware_info *qe_get_firmware_info(void)
 	}
=20
 	/* Find the 'firmware' child node */
-	for_each_child_of_node(qe, fw) {
-		if (strcmp(fw->name, "firmware") =3D=3D 0)
-			break;
-	}
-
+	fw =3D of_get_child_by_name(qe, "firmware");
 	of_node_put(qe);
=20
 	/* Did we find the 'firmware' node? */
--
Acked-by: Qiang Zhao <qiang.zhao@nxp.com>

Re: [PATCH] soc: fsl/qe: Use of_get_child_by_name helper

From: Li Yang <hidden>
Date: 2018-08-30 17:05:03

On Wed, Aug 29, 2018 at 9:49 PM Qiang Zhao [off-list ref] wrote:
From: Rob Herring <robh@kernel.org>
date: 2018/8/30 4:04
quoted
To: Qiang Zhao <qiang.zhao@nxp.com>
Cc: linux-kernel@vger.kernel.org; Leo Li <redacted>;
linuxppc-dev@lists.ozlabs.org; linux-arm-kernel@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 <qiang.zhao@nxp.com>
Cc: Li Yang <redacted>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
Merged for next.  Thanks.

Regards,
Leo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help