/* Returns a voltage that can be passed to @regulator_set_voltage(), zero if this selector code can't be used on this sytem, or a negative errno.  */
int regulator_list_voltage(struct regulator *regulator, unsigned selector)
/* Returns a voltage that can be passed to @regulator_set_voltage(), zero if this selector code can't be used on this sytem, or a negative errno.  */
int regulator_list_voltage(struct regulator *regulator, unsigned selector)
{
	struct regulator_dev	*rdev = regulator->rdev;
	struct regulator_ops	*ops = rdev->desc->ops;
	int			ret;
	if (!ops->list_voltage || selector >= rdev->desc->n_voltages)
		return -EINVAL;
	mutex_lock(&rdev->mutex);
	ret = ops->list_voltage(rdev, selector);
	mutex_unlock(&rdev->mutex);
	if (ret > 0) {
		if (ret < rdev->constraints->min_uV)
			ret = 0;
		else if (ret > rdev->constraints->max_uV)
			ret = 0;
	}
	return ret;
}