usb: dm: Make "usb info" use usb_for_each_root_dev()
authorHans de Goede <hdegoede@redhat.com>
Sun, 3 Jul 2016 18:22:05 +0000 (20:22 +0200)
committerMarek Vasut <marex@denx.de>
Tue, 5 Jul 2016 12:14:11 +0000 (14:14 +0200)
commite6e188f5623e3db7fcba785f4246d16425dd2104
tree88f6e27f6879e9f487984fa02efad750bb274cf3
parent2138fd6d5d358bcfef6631300763c16a70f2af3d
usb: dm: Make "usb info" use usb_for_each_root_dev()

The old dm "usb info" implementation has several issues:

1) NULL pointer deref when a bus has no children
2) Not showing usb devices on busses without an emulated root-hub (otg host)
3) Attempting to show devices on inactive busses
4) "usb info" Would cause some hosts to get re-probed something which only
   "usb reset" should do

TL;DR: proper iterating over usb bus root devs is hard, use the helper
for it.

Reported-by: Bernhard Nortmann <bernhard.nortmann@web.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
cmd/usb.c