diff options
author | Mark Brown <broonie@kernel.org> | 2015-08-07 13:00:35 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-08-07 13:03:20 +0100 |
commit | 7cd71c3ba166913a0afb8ac0d6bd5d2730fea6df (patch) | |
tree | 6cec7bd12d0fe054853a584e009abac1056c760a /drivers/regulator/core.c | |
parent | 70cfef26267474f94ff4a988fb45ff78442b1cf4 (diff) | |
download | linux-7cd71c3ba166913a0afb8ac0d6bd5d2730fea6df.tar.bz2 |
regulator: core: Drop regulator_list_mutex when we're done with it on remove
When removing a regulator we hold regulator_list_mutex in order to
ensure the regualtor doesn't become removed again. However we only need
to protect the list until we remove the regulator from the list so move
the unlock earlier to reduce the locked region.
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 68b616580533..62e4f3bd5783 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3827,11 +3827,11 @@ void regulator_unregister(struct regulator_dev *rdev) WARN_ON(rdev->open_count); unset_regulator_supplies(rdev); list_del(&rdev->list); + mutex_unlock(®ulator_list_mutex); kfree(rdev->constraints); regulator_ena_gpio_free(rdev); of_node_put(rdev->dev.of_node); device_unregister(&rdev->dev); - mutex_unlock(®ulator_list_mutex); } EXPORT_SYMBOL_GPL(regulator_unregister); |