|
@@ -1901,8 +1901,6 @@ static int _regulator_do_disable(struct regulator_dev *rdev)
|
|
|
|
|
|
trace_regulator_disable_complete(rdev_get_name(rdev));
|
|
trace_regulator_disable_complete(rdev_get_name(rdev));
|
|
|
|
|
|
- _notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
|
|
|
|
- NULL);
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1926,6 +1924,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
|
|
rdev_err(rdev, "failed to disable\n");
|
|
rdev_err(rdev, "failed to disable\n");
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
+ _notifier_call_chain(rdev, REGULATOR_EVENT_DISABLE,
|
|
|
|
+ NULL);
|
|
}
|
|
}
|
|
|
|
|
|
rdev->use_count = 0;
|
|
rdev->use_count = 0;
|
|
@@ -1978,20 +1978,16 @@ static int _regulator_force_disable(struct regulator_dev *rdev)
|
|
{
|
|
{
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
- /* force disable */
|
|
|
|
- if (rdev->desc->ops->disable) {
|
|
|
|
- /* ah well, who wants to live forever... */
|
|
|
|
- ret = rdev->desc->ops->disable(rdev);
|
|
|
|
- if (ret < 0) {
|
|
|
|
- rdev_err(rdev, "failed to force disable\n");
|
|
|
|
- return ret;
|
|
|
|
- }
|
|
|
|
- /* notify other consumers that power has been forced off */
|
|
|
|
- _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
|
|
|
|
- REGULATOR_EVENT_DISABLE, NULL);
|
|
|
|
|
|
+ ret = _regulator_do_disable(rdev);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ rdev_err(rdev, "failed to force disable\n");
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
- return ret;
|
|
|
|
|
|
+ _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE |
|
|
|
|
+ REGULATOR_EVENT_DISABLE, NULL);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -3624,8 +3620,6 @@ int regulator_suspend_finish(void)
|
|
|
|
|
|
mutex_lock(®ulator_list_mutex);
|
|
mutex_lock(®ulator_list_mutex);
|
|
list_for_each_entry(rdev, ®ulator_list, list) {
|
|
list_for_each_entry(rdev, ®ulator_list, list) {
|
|
- struct regulator_ops *ops = rdev->desc->ops;
|
|
|
|
-
|
|
|
|
mutex_lock(&rdev->mutex);
|
|
mutex_lock(&rdev->mutex);
|
|
if (rdev->use_count > 0 || rdev->constraints->always_on) {
|
|
if (rdev->use_count > 0 || rdev->constraints->always_on) {
|
|
error = _regulator_do_enable(rdev);
|
|
error = _regulator_do_enable(rdev);
|
|
@@ -3634,12 +3628,10 @@ int regulator_suspend_finish(void)
|
|
} else {
|
|
} else {
|
|
if (!have_full_constraints())
|
|
if (!have_full_constraints())
|
|
goto unlock;
|
|
goto unlock;
|
|
- if (!ops->disable)
|
|
|
|
- goto unlock;
|
|
|
|
if (!_regulator_is_enabled(rdev))
|
|
if (!_regulator_is_enabled(rdev))
|
|
goto unlock;
|
|
goto unlock;
|
|
|
|
|
|
- error = ops->disable(rdev);
|
|
|
|
|
|
+ error = _regulator_do_disable(rdev);
|
|
if (error)
|
|
if (error)
|
|
ret = error;
|
|
ret = error;
|
|
}
|
|
}
|
|
@@ -3813,7 +3805,7 @@ static int __init regulator_init_complete(void)
|
|
ops = rdev->desc->ops;
|
|
ops = rdev->desc->ops;
|
|
c = rdev->constraints;
|
|
c = rdev->constraints;
|
|
|
|
|
|
- if (!ops->disable || (c && c->always_on))
|
|
|
|
|
|
+ if (c && c->always_on)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
mutex_lock(&rdev->mutex);
|
|
mutex_lock(&rdev->mutex);
|
|
@@ -3834,7 +3826,7 @@ static int __init regulator_init_complete(void)
|
|
/* We log since this may kill the system if it
|
|
/* We log since this may kill the system if it
|
|
* goes wrong. */
|
|
* goes wrong. */
|
|
rdev_info(rdev, "disabling\n");
|
|
rdev_info(rdev, "disabling\n");
|
|
- ret = ops->disable(rdev);
|
|
|
|
|
|
+ ret = _regulator_do_disable(rdev);
|
|
if (ret != 0)
|
|
if (ret != 0)
|
|
rdev_err(rdev, "couldn't disable: %d\n", ret);
|
|
rdev_err(rdev, "couldn't disable: %d\n", ret);
|
|
} else {
|
|
} else {
|