提交 7cd71c3b 编写于 作者: M Mark Brown

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: NMark Brown <broonie@kernel.org>
上级 70cfef26
...@@ -3827,11 +3827,11 @@ void regulator_unregister(struct regulator_dev *rdev) ...@@ -3827,11 +3827,11 @@ void regulator_unregister(struct regulator_dev *rdev)
WARN_ON(rdev->open_count); WARN_ON(rdev->open_count);
unset_regulator_supplies(rdev); unset_regulator_supplies(rdev);
list_del(&rdev->list); list_del(&rdev->list);
mutex_unlock(&regulator_list_mutex);
kfree(rdev->constraints); kfree(rdev->constraints);
regulator_ena_gpio_free(rdev); regulator_ena_gpio_free(rdev);
of_node_put(rdev->dev.of_node); of_node_put(rdev->dev.of_node);
device_unregister(&rdev->dev); device_unregister(&rdev->dev);
mutex_unlock(&regulator_list_mutex);
} }
EXPORT_SYMBOL_GPL(regulator_unregister); EXPORT_SYMBOL_GPL(regulator_unregister);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册