dm: usb: Do not use bus->seq before device_probe(bus)
PATCH 1/1 dm: usb: Do not use bus->seq before device_probe(bus)
Do not use bus->seq before device_probe(bus), as bus->seq is not set until
after the device_probe() call. This fixes u-boot printing: "USB-1: " for
each bus it scans.
--- drivers/usb/host/usb-uclass.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/host/usb-uclass.c +1 -2
@@ -181,9 +181,8 @@ int usb_init(void) uclass_foreach_dev(bus, uc) {/* init low_level USB */ +printf ("USB%d: " , count); count++; -printf ("USB" ); -printf ("%d: " , bus->seq); ret =device_probe (bus);if (ret == -ENODEV ) {/* No such device. */ puts ("Port not available.\n" );
Signature · 1 line
2.3.6
PATCH 1/1 dm: usb: Do not use bus->seq before device_probe(bus)
Hi Hans,
Quoted 14 lines · Hans de Goede
Do not use
bus->seqbeforedevice_probe(bus), asbus->seqis not set until
after thedevice_probe()call. This fixes u-boot printing: "USB-1: " for
each bus it scans.Signed-off-by Hans de Goede <[email protected]>--- drivers/usb/host/usb-uclass.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/host/usb-uclass.c +0
-0
drivers/usb/host/usb-uclass.c int usb_init(void) · line 184
Quoted 4 lines
drivers/usb/host/usb-uclass.c +1
-0@@ -181,9 +181,8 @@ int usb_init(void) uclass_foreach_dev(bus, uc) {/* init low_level USB */ +printf ("USB%d: " , count);
This might be confusing if bus->seq ends up being something else. But I don't have a better idea and I've been thinking about it for a while.
Quoted 9 lines
drivers/usb/host/usb-uclass.c +0
-3count++; -printf ("USB" ); -printf ("%d: " , bus->seq); ret =device_probe (bus);if (ret == -ENODEV ) {/* No such device. */ puts ("Port not available.\n" ); --2.3.6
Regards,
Simon
PATCH 1/1 dm: usb: Do not use bus->seq before device_probe(bus)
Quoted 38 lines · Simon Glass
Hi Hans,
Quoted 14 lines · Hans de Goede
Do not use
bus->seqbeforedevice_probe(bus), asbus->seqis not set until
after thedevice_probe()call. This fixes u-boot printing: "USB-1: " for
each bus it scans.Signed-off-by Hans de Goede <[email protected]>--- drivers/usb/host/usb-uclass.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/usb/host/usb-uclass.c +0
-0drivers/usb/host/usb-uclass.c int usb_init(void) · line 184
Quoted 4 lines
drivers/usb/host/usb-uclass.c +1
-0@@ -181,9 +181,8 @@ int usb_init(void) uclass_foreach_dev(bus, uc) {/* init low_level USB */ +printf ("USB%d: " , count);This might be confusing if
bus->seqends up being something else. But I don't have a better idea and I've been thinking about it for a while.Acked-by Simon Glass <[email protected]>Quoted 9 lines
drivers/usb/host/usb-uclass.c +0
-3count++; -printf ("USB" ); -printf ("%d: " , bus->seq); ret =device_probe (bus);if (ret == -ENODEV ) {/* No such device. */ puts ("Port not available.\n" ); --2.3.6
Quoted 2 lines
Regards,
Simon
Applied to u-boot-dm, thanks!