UPSTREAM: usb: dwc3: fix runtime PM in error path
authorRoger Quadros <rogerq@ti.com>
Fri, 10 Jun 2016 11:38:02 +0000 (14:38 +0300)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
commit172121786ce09a2751c1ba4641a599ccb04db36b
treea3f7313f30f6e5ae7dfbfec0b11f43e6e6fb81ba
parent13f2374f1b1b13f6fd1760987df7066dda6420b1
UPSTREAM: usb: dwc3: fix runtime PM in error path

If there is a failure after pm_runtime_enable/get_sync()
we need to call pm_runtime_disable/put_sync().

Otherwise it will lead to an unbalanced pm_runtime_enable() on the
subsequent probe if the earlier probe bailed out due to -EPROBE_DEFER.

pm_runtime_get_sync() can fail as well so deal with that case too.

Change-Id: Ia8af31867e996eeee4b0a18e34303280b661a86c
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 328082376aea6016b63bca1e5c067a9539f9e8c9)
drivers/usb/dwc3/core.c