]> git.ipfire.org Git - people/ms/u-boot.git/commit
dm: usb: Move descriptor setup code into its own function
authorSimon Glass <sjg@chromium.org>
Wed, 25 Mar 2015 18:22:05 +0000 (12:22 -0600)
committerSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2015 17:11:21 +0000 (11:11 -0600)
commit128fcac087664b63757bc2bb2a9fd943bd2b797d
treef8e1227b127f698837110ed53cdfec6a1686268c
parent862e75c0dbb578ec2e1f374794007048f3dd29c6
dm: usb: Move descriptor setup code into its own function

usb_new_device() is far too long and does far too much. As a first step, move
the code that does initial setup and reads a descriptor into its own function
called usb_setup_descriptor().

For XHCI the init order is different - we set up the device but don't
actually read the descriptor until after we set an address. Support this
option as a parameter to usb_setup_descriptor().

Avoid changing this torturous code more than necessary to make it easy to
review.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
common/usb.c