linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: fsl/qe: Use of_get_child_by_name helper
@ 2018-08-29 20:04 Rob Herring
  2018-08-30  2:47 ` Qiang Zhao
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2018-08-29 20:04 UTC (permalink / raw)
  To: Qiang Zhao; +Cc: linux-kernel, Li Yang, linuxppc-dev, linux-arm-kernel

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] soc: fsl/qe: Use of_get_child_by_name helper
  2018-08-29 20:04 [PATCH] soc: fsl/qe: Use of_get_child_by_name helper Rob Herring
@ 2018-08-30  2:47 ` Qiang Zhao
  2018-08-30 17:04   ` Li Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Qiang Zhao @ 2018-08-30  2:47 UTC (permalink / raw)
  To: Rob Herring; +Cc: linux-kernel, Leo Li, linuxppc-dev, linux-arm-kernel

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 <leoyang.li@nxp.com>;
> 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 <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>
> ---
>  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? */
> --

Acked-by: Qiang Zhao <qiang.zhao@nxp.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] soc: fsl/qe: Use of_get_child_by_name helper
  2018-08-30  2:47 ` Qiang Zhao
@ 2018-08-30 17:04   ` Li Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Li Yang @ 2018-08-30 17:04 UTC (permalink / raw)
  To: Zhao Qiang
  Cc: Rob Herring, lkml, linuxppc-dev,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

On Wed, Aug 29, 2018 at 9:49 PM Qiang Zhao <qiang.zhao@nxp.com> wrote:
>
> 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 <leoyang.li@nxp.com>;
> > 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 <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>

Merged for next.  Thanks.

Regards,
Leo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-30 17:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29 20:04 [PATCH] soc: fsl/qe: Use of_get_child_by_name helper Rob Herring
2018-08-30  2:47 ` Qiang Zhao
2018-08-30 17:04   ` Li Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).