diff mbox series

[3/6] mach-snapdragon: of_fixup: skip disabled USB nodes

Message ID 20250409-livetree-fixup-v1-3-76dfea80b07f@linaro.org
State New
Headers show
Series Qualcomm: cleanup OF_LIVE fixup and fix RB1/2 | expand

Commit Message

Caleb Connolly April 9, 2025, 5:17 p.m. UTC
There's no need to waste time fixing up nodes that aren't used on this
device. Skip them.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 arch/arm/mach-snapdragon/of_fixup.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Neil Armstrong April 10, 2025, 7:45 a.m. UTC | #1
On 09/04/2025 19:17, Caleb Connolly wrote:
> There's no need to waste time fixing up nodes that aren't used on this
> device. Skip them.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>   arch/arm/mach-snapdragon/of_fixup.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c
> index d4e24059212c552de7fa7555d2ab8a1ea4fc4cb2..b39036e8e0890fdf834a0dfe6966ef3dd365f3d2 100644
> --- a/arch/arm/mach-snapdragon/of_fixup.c
> +++ b/arch/arm/mach-snapdragon/of_fixup.c
> @@ -107,8 +107,10 @@ static void fixup_usb_nodes(void)
>   	struct device_node *glue_np = NULL;
>   	int ret;
>   
>   	while ((glue_np = of_find_compatible_node(glue_np, NULL, "qcom,dwc3"))) {
> +		if (!of_device_is_available(glue_np))
> +			continue;
>   		ret = fixup_qcom_dwc3(glue_np);
>   		if (ret)
>   			log_warning("Failed to fixup node %s: %d\n", glue_np->name, ret);
>   	}
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Sumit Garg April 10, 2025, 8:51 a.m. UTC | #2
On Wed, Apr 09, 2025 at 07:17:26PM +0200, Caleb Connolly wrote:
> There's no need to waste time fixing up nodes that aren't used on this
> device. Skip them.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>  arch/arm/mach-snapdragon/of_fixup.c | 2 ++
>  1 file changed, 2 insertions(+)
>

Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

-Sumit

> diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c
> index d4e24059212c552de7fa7555d2ab8a1ea4fc4cb2..b39036e8e0890fdf834a0dfe6966ef3dd365f3d2 100644
> --- a/arch/arm/mach-snapdragon/of_fixup.c
> +++ b/arch/arm/mach-snapdragon/of_fixup.c
> @@ -107,8 +107,10 @@ static void fixup_usb_nodes(void)
>  	struct device_node *glue_np = NULL;
>  	int ret;
>  
>  	while ((glue_np = of_find_compatible_node(glue_np, NULL, "qcom,dwc3"))) {
> +		if (!of_device_is_available(glue_np))
> +			continue;
>  		ret = fixup_qcom_dwc3(glue_np);
>  		if (ret)
>  			log_warning("Failed to fixup node %s: %d\n", glue_np->name, ret);
>  	}
> 
> -- 
> 2.49.0
>
diff mbox series

Patch

diff --git a/arch/arm/mach-snapdragon/of_fixup.c b/arch/arm/mach-snapdragon/of_fixup.c
index d4e24059212c552de7fa7555d2ab8a1ea4fc4cb2..b39036e8e0890fdf834a0dfe6966ef3dd365f3d2 100644
--- a/arch/arm/mach-snapdragon/of_fixup.c
+++ b/arch/arm/mach-snapdragon/of_fixup.c
@@ -107,8 +107,10 @@  static void fixup_usb_nodes(void)
 	struct device_node *glue_np = NULL;
 	int ret;
 
 	while ((glue_np = of_find_compatible_node(glue_np, NULL, "qcom,dwc3"))) {
+		if (!of_device_is_available(glue_np))
+			continue;
 		ret = fixup_qcom_dwc3(glue_np);
 		if (ret)
 			log_warning("Failed to fixup node %s: %d\n", glue_np->name, ret);
 	}