Skip to contentSkip to conversation

usb: host: Print device name when scanning

PATCH Superseded Ismael Luceno Cortes 2 participants 2 messages Mar 18, 2019 USB

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: host: Print device name when scanning

The name assigned to the USB host controller interface is a better indicator than the counter currently in use (which has no meaning other than being the order in which the interface is found).

Example of the original output:

Quoted 3 lines

USB0: USB EHCI 1.10
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found

Patched output:

Quoted 3 lines

USB0(usb at ee080100): USB EHCI 1.10
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found

---

Notes:
Changes since v1:
- Improved commit message.

 drivers/usb/host/usb-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/usb-uclass.c +1 -1
index 611ea97a72..0575f5393b 100644
@@ -255,7 +255,7 @@ int usb_init(void)
 
 	uclass_foreach_dev(bus, uc) {
 		/* init low_level USB */
-		printf("USB%d:   ", count);
+		printf("USB%d(%s):   ", count, bus->name);
 		count++;
 
 #ifdef CONFIG_SANDBOX

base-commit: 9ba5e5bc261a16f51662490da0cf620dc7f29013

Signature · 1 line
2.19.1
#1 lore raw

PATCH v2 1/1 usb: host: Print device name when scanning

Quoted 29 lines · Ismael Luceno Cortes

The name assigned to the USB host controller interface is a better indicator than the counter currently in use (which has no meaning other than being the order in which the interface is found).

Example of the original output:

Quoted 3 lines

USB0: USB EHCI 1.10
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found

Patched output:

Quoted 3 lines

USB0(usb at ee080100): USB EHCI 1.10
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found

---

Notes:
Changes since v1:
- Improved commit message.

 drivers/usb/host/usb-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/usb-uclass.c +0 -0
index 611ea97a72..0575f5393b 100644

drivers/usb/host/usb-uclass.c int usb_init(void) · line 259

Quoted 6 lines
drivers/usb/host/usb-uclass.c +1 -1
@@ -255,7 +255,7 @@ int usb_init(void)
 
 	uclass_foreach_dev(bus, uc) {
 		/* init low_level USB */
-		printf("USB%d:   ", count);
+		printf("USB%d(%s):   ", count, bus->name);
 		count++;

Hmmm, why dont we just drop the count altogether then ?

The output would then be:

USB %s: USB EHCI...
scanning bus %s for devices...

for %s being the bus->name.

With the improved commit message, this would actually make sense. Does that make sense to you too or am I missing something ?

Quoted 4 lines
drivers/usb/host/usb-uclass.c +0 -0
 #ifdef CONFIG_SANDBOX
 

base-commit: 9ba5e5bc261a16f51662490da0cf620dc7f29013

Signature · 2 lines
Best regards,
Marek Vasut