diff mbox series

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

Message ID 20200731074505.25642-1-patrice.chotard@st.com
State Accepted
Commit f3858ce029915b8e737b56e0e30f7cdca52a7ebd
Delegated to: Patrice Chotard
Headers show
Series [RESEND] usb: host: dwc3-sti-glue: Fix ofnode_valid() parameter | expand

Commit Message

Patrice CHOTARD July 31, 2020, 7:45 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>
Cc: Kever Yang <kever.yang@rock-chips.com>
---

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

Comments

Marek Vasut July 31, 2020, 5:47 p.m. UTC | #1
On 7/31/20 9:45 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")

Looks OK to me, feel free to pick it via ST tree.
Patrice CHOTARD Aug. 3, 2020, 7:37 a.m. UTC | #2
On 7/31/20 7:47 PM, Marek Vasut wrote:
> On 7/31/20 9:45 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")
> Looks OK to me, feel free to pick it via ST tree.

Ok thanks

Patrice
Patrice CHOTARD Aug. 13, 2020, 10:03 a.m. UTC | #3
On 8/3/20 9:37 AM, Patrice CHOTARD wrote:
> On 7/31/20 7:47 PM, Marek Vasut wrote:
>> On 7/31/20 9:45 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")
>> Looks OK to me, feel free to pick it via ST tree.

Applied on u-boot-stm/master

Thanks

> Ok thanks
>
> Patrice
> _______________________________________________
> Uboot-stm32 mailing list
> Uboot-stm32@st-md-mailman.stormreply.com
> https://st-md-mailman.stormreply.com/mailman/listinfo/uboot-stm32
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;
 	}