From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ismael Luceno Cortes Date: Thu, 14 Mar 2019 16:19:43 +0000 Subject: [U-Boot] [PATCH] usb: host: Print device name when scanning In-Reply-To: References: <20190218092353.4710-1-ismael.luceno@silicon-gears.com> <20190314114429.GA3468@kiki> <828d8f6b-9119-19cf-39de-6287d2d8e5ba@gmail.com> <20190314125713.GB3468@kiki> Message-ID: <20190314161943.GD3468@kiki> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 14/Mar/2019 16:09, Marek Vasut wrote: > On 3/14/19 1:57 PM, Ismael Luceno Cortes wrote: > > On 14/Mar/2019 12:55, Marek Vasut wrote: > >> On 3/14/19 12:44 PM, Ismael Luceno Cortes wrote: > >>> On 18/Feb/2019 09:23, Ismael Luceno Cortes wrote: > >>>> Signed-off-by: Ismael Luceno > >>>> --- > >>>> drivers/usb/host/usb-uclass.c | 2 +- > >>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>> > >>>> diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c > >>>> index 611ea97a72..0575f5393b 100644 > >>>> --- a/drivers/usb/host/usb-uclass.c > >>>> +++ b/drivers/usb/host/usb-uclass.c > >>>> @@ -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 > >>>> -- > >>>> 2.19.1 > >>> > >>> Ping. > >> > >> What is this patch doing ? The commit description doesn't explain > >> anything about it. > > > > It prints the host device name. I'm not sure the count is at all useful > > given there's a name... > > If you could share the log before and after to better illustrate the > difference, that'd be nice. unpatched: => usb reset resetting USB... 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: => usb reset resetting USB... 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 > However, shouldn't the same approach be applied to 'usb tree' subcommand > and possibly others ? The number shown during usb scanning is not used nor saved anywhere else, so seems pretty useless and a special case. OTOH the number used in the usb tree command is taken from struct usb_device, and is used for lookups. The name is only relevant to non-discoverable devices at the moment. dm tree shows: ... ehci_generic | |-- usb at ee080100 ... usb_hub | | `-- usb_hub ... usb_mass_storage | | `-- usb_mass_storage ... usb_storage_blk | | `-- usb_mass_storage.lun0