* [PATCH] regulator: core: Drop regulator_list_mutex when we're done with it on remove
@ 2015-08-07 12:03 Mark Brown
0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2015-08-07 12:03 UTC (permalink / raw)
To: Liam Girdwood; +Cc: linux-kernel, Mark Brown
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>
---
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6130346..b127373 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3847,11 +3847,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);
--
2.5.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-07 12:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-07 12:03 [PATCH] regulator: core: Drop regulator_list_mutex when we're done with it on remove Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®