usb: dwc3: fix runtime PM in error path
authorRoger Quadros <rogerq@ti.com>
Fri, 10 Jun 2016 11:38:02 +0000 (14:38 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 21 Jun 2016 07:38:43 +0000 (10:38 +0300)
commit328082376aea6016b63bca1e5c067a9539f9e8c9
tree015614fec0a9c5ad9014f5892b8aa9ec0ac5381b
parentb6d4e16e831376b676edb3463f2bdaa192e5f7be
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.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/core.c