Files
u-boot/drivers
Hans de Goede 7c22e26ec5 sunxi: musb: Re-init musb controller on repeated probe calls
With sunxi-musb musb_lowlevel_init() can fail when a charger; or no cable
is plugged into the otg port.

To avoid leaking the struct musb allocated by musb_init_controller()
on repeated musb_usb_probe() calls, we were caching its result.
But musb_init_controller() does more, such as calling sunxi_musb_init()
which enables the clocks.

Not calling sunxi_musb_init() causes the musb controller to stop working
after a "usb reset" since that calls musb_usb_remove() which disables the
clocks.

This commit fixes this by removing the caching of the struct returned
from musb_init_controller(), it replaces this by free-ing the allocated
memory in musb_usb_remove() and calling musb_usb_remove() on
musb_usb_probe() errors to ensure proper cleanup.

While at it also make musb_usb_probe() and musb_usb_remove() static.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-09-18 14:39:16 +02:00
..
2016-08-02 09:47:34 -07:00
2016-09-01 20:08:48 -05:00
2016-01-27 15:32:05 +01:00
2016-08-15 15:29:03 -05:00
2016-08-15 10:26:13 -07:00
2016-07-14 18:33:11 -04:00
2016-02-06 12:00:59 +01:00
2016-08-25 15:35:03 -07:00
2016-08-12 16:00:50 -04:00
2016-03-14 19:21:44 -04:00