usb: dwc3-msm: Fix driver removal
When performing driver unbind, several crashes are occuring in
the dwc3_msm_remove() function. This patch fixes the following:
- Disable runtime PM first to prevent any races with any suspend/
resume happening during removal. It also places the device in
active state so as to avoid clk_disable() multiple times.
- Replace device_init_wakeup(dev, 0) call with device_wakeup_disable()
which properly removes the device's wakeup source. Otherwise
it can remain active and prevent system suspend.
- Since of_platform_populate() is called in probe to add children
in the device tree, we must unregister them using
device_for_each_child().
- Fix the NULL check for mdwc->ext_chg_device when calling its
removal routines.
Change-Id: I03b6db022e5f2a6ca4b63d0eddcad532d6f1f5e7
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment