/* Configure each regulator with it's suspend operating parameters for state. This will usually be called by machine suspend code prior to supending.  */
int regulator_suspend_prepare(suspend_state_t state)
/* Configure each regulator with it's suspend operating parameters for state. This will usually be called by machine suspend code prior to supending.  */
int regulator_suspend_prepare(suspend_state_t state)
{
	struct regulator_dev *rdev;
	int ret = 0;
	if (state == PM_SUSPEND_ON)
		return -EINVAL;
	mutex_lock(&regulator_list_mutex);
	list_for_each_entry(rdev, &regulator_list, list) {
		mutex_lock(&rdev->mutex);
		ret = suspend_prepare(rdev, state);
		mutex_unlock(&rdev->mutex);
		if (ret < 0) {
			printk(KERN_ERR "%s: failed to prepare %s\n",
				__func__, rdev_get_name(rdev));
			goto out;
		}
	}
out:
	mutex_unlock(&regulator_list_mutex);
	return ret;
}