regulator: Fix deadlock on removal of regulators with supplies
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 28 Mar 2012 20:17:55 +0000 (21:17 +0100)
committerVarun Wadekar <vwadekar@nvidia.com>
Wed, 18 Apr 2012 13:06:43 +0000 (18:06 +0530)
commit9e4c841a11000d1a5d2fe62c705e52c9978dee36
tree3ff1192919370522b6af205ad9492fa644b08e1d
parentffff7b0f7306b4f9f73760f99fb68b36887c13fb
regulator: Fix deadlock on removal of regulators with supplies

If a regulator with a supply is being unregistered we will call
regulator_put() to release the supply with the regulator_list_mutex held
but this deadlocks as regulator_put() takes the same lock. Fix this by
releasing the supply before we take the mutex in regulator_unregister().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c