diff mbox series

usb: host: dwc3-sti-glue: Fix ofnode_valid() parameter

Message ID 20200629092633.24545-1-patrice.chotard@st.com
State Superseded
Delegated to: Marek Vasut
Headers show
Series usb: host: dwc3-sti-glue: Fix ofnode_valid() parameter | expand

Commit Message

Patrice CHOTARD June 29, 2020, 9:26 a.m. UTC
node varaible is used as iterator into ofnode_for_each_subnode()
loop, when exiting of it, node is no more a valid ofnode.
Use dwc3_node instead as parameter of ofnode_valid()

Fixes: ac28e59a574d ("usb: Migrate to support live DT for some driver")
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---

 drivers/usb/host/dwc3-sti-glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Patrice CHOTARD July 28, 2020, 8:54 a.m. UTC | #1
Hi

Just a gentle reminder as this patch is present on mailing list since 2 months.

Regards

Patrice

On 6/29/20 11:26 AM, Patrice Chotard wrote:
> node varaible is used as iterator into ofnode_for_each_subnode()
> loop, when exiting of it, node is no more a valid ofnode.
> Use dwc3_node instead as parameter of ofnode_valid()
>
> Fixes: ac28e59a574d ("usb: Migrate to support live DT for some driver")
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>
>  drivers/usb/host/dwc3-sti-glue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c
> index a72ab20168..3e6c1429d6 100644
> --- a/drivers/usb/host/dwc3-sti-glue.c
> +++ b/drivers/usb/host/dwc3-sti-glue.c
> @@ -159,7 +159,7 @@ static int sti_dwc3_glue_bind(struct udevice *dev)
>  			dwc3_node = node;
>  	}
>  
> -	if (!ofnode_valid(node)) {
> +	if (!ofnode_valid(dwc3_node)) {
>  		pr_err("Can't find dwc3 subnode for %s\n", dev->name);
>  		return -ENODEV;
>  	}
diff mbox series

Patch

diff --git a/drivers/usb/host/dwc3-sti-glue.c b/drivers/usb/host/dwc3-sti-glue.c
index a72ab20168..3e6c1429d6 100644
--- a/drivers/usb/host/dwc3-sti-glue.c
+++ b/drivers/usb/host/dwc3-sti-glue.c
@@ -159,7 +159,7 @@  static int sti_dwc3_glue_bind(struct udevice *dev)
 			dwc3_node = node;
 	}
 
-	if (!ofnode_valid(node)) {
+	if (!ofnode_valid(dwc3_node)) {
 		pr_err("Can't find dwc3 subnode for %s\n", dev->name);
 		return -ENODEV;
 	}