diff options
| -rw-r--r-- | drivers/regulator/core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c9f72019bd68..68b616580533 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
| @@ -640,6 +640,8 @@ static int drms_uA_update(struct regulator_dev *rdev) | |||
| 640 | int current_uA = 0, output_uV, input_uV, err; | 640 | int current_uA = 0, output_uV, input_uV, err; |
| 641 | unsigned int mode; | 641 | unsigned int mode; |
| 642 | 642 | ||
| 643 | lockdep_assert_held_once(&rdev->mutex); | ||
| 644 | |||
| 643 | /* | 645 | /* |
| 644 | * first check to see if we can set modes at all, otherwise just | 646 | * first check to see if we can set modes at all, otherwise just |
| 645 | * tell the consumer everything is OK. | 647 | * tell the consumer everything is OK. |
| @@ -760,6 +762,8 @@ static int suspend_set_state(struct regulator_dev *rdev, | |||
| 760 | /* locks held by caller */ | 762 | /* locks held by caller */ |
| 761 | static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state) | 763 | static int suspend_prepare(struct regulator_dev *rdev, suspend_state_t state) |
| 762 | { | 764 | { |
| 765 | lockdep_assert_held_once(&rdev->mutex); | ||
| 766 | |||
| 763 | if (!rdev->constraints) | 767 | if (!rdev->constraints) |
| 764 | return -EINVAL; | 768 | return -EINVAL; |
| 765 | 769 | ||
| @@ -1587,6 +1591,8 @@ static void _regulator_put(struct regulator *regulator) | |||
| 1587 | if (regulator == NULL || IS_ERR(regulator)) | 1591 | if (regulator == NULL || IS_ERR(regulator)) |
| 1588 | return; | 1592 | return; |
| 1589 | 1593 | ||
| 1594 | lockdep_assert_held_once(®ulator_list_mutex); | ||
| 1595 | |||
| 1590 | rdev = regulator->rdev; | 1596 | rdev = regulator->rdev; |
| 1591 | 1597 | ||
| 1592 | debugfs_remove_recursive(regulator->debugfs); | 1598 | debugfs_remove_recursive(regulator->debugfs); |
| @@ -1965,6 +1971,8 @@ static int _regulator_enable(struct regulator_dev *rdev) | |||
| 1965 | { | 1971 | { |
| 1966 | int ret; | 1972 | int ret; |
| 1967 | 1973 | ||
| 1974 | lockdep_assert_held_once(&rdev->mutex); | ||
| 1975 | |||
| 1968 | /* check voltage and requested load before enabling */ | 1976 | /* check voltage and requested load before enabling */ |
| 1969 | if (rdev->constraints && | 1977 | if (rdev->constraints && |
| 1970 | (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_DRMS)) | 1978 | (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_DRMS)) |
| @@ -2065,6 +2073,8 @@ static int _regulator_disable(struct regulator_dev *rdev) | |||
| 2065 | { | 2073 | { |
| 2066 | int ret = 0; | 2074 | int ret = 0; |
| 2067 | 2075 | ||
| 2076 | lockdep_assert_held_once(&rdev->mutex); | ||
| 2077 | |||
| 2068 | if (WARN(rdev->use_count <= 0, | 2078 | if (WARN(rdev->use_count <= 0, |
| 2069 | "unbalanced disables for %s\n", rdev_get_name(rdev))) | 2079 | "unbalanced disables for %s\n", rdev_get_name(rdev))) |
| 2070 | return -EIO; | 2080 | return -EIO; |
| @@ -2143,6 +2153,8 @@ static int _regulator_force_disable(struct regulator_dev *rdev) | |||
| 2143 | { | 2153 | { |
| 2144 | int ret = 0; | 2154 | int ret = 0; |
| 2145 | 2155 | ||
| 2156 | lockdep_assert_held_once(&rdev->mutex); | ||
| 2157 | |||
| 2146 | ret = _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE | | 2158 | ret = _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE | |
| 2147 | REGULATOR_EVENT_PRE_DISABLE, NULL); | 2159 | REGULATOR_EVENT_PRE_DISABLE, NULL); |
| 2148 | if (ret & NOTIFY_STOP_MASK) | 2160 | if (ret & NOTIFY_STOP_MASK) |
| @@ -3439,6 +3451,8 @@ EXPORT_SYMBOL_GPL(regulator_bulk_free); | |||
| 3439 | int regulator_notifier_call_chain(struct regulator_dev *rdev, | 3451 | int regulator_notifier_call_chain(struct regulator_dev *rdev, |
| 3440 | unsigned long event, void *data) | 3452 | unsigned long event, void *data) |
| 3441 | { | 3453 | { |
| 3454 | lockdep_assert_held_once(&rdev->mutex); | ||
| 3455 | |||
| 3442 | _notifier_call_chain(rdev, event, data); | 3456 | _notifier_call_chain(rdev, event, data); |
| 3443 | return NOTIFY_DONE; | 3457 | return NOTIFY_DONE; |
| 3444 | 3458 | ||
