/* Returns a boolean or a negative error code.  */
int regulator_is_supported_voltage(struct regulator *regulator, int min_uV, int max_uV)
/* Returns a boolean or a negative error code.  */
int regulator_is_supported_voltage(struct regulator *regulator, int min_uV, int max_uV)
{
	int i, voltages, ret;
	ret = regulator_count_voltages(regulator);
	if (ret < 0)
		return ret;
	voltages = ret;
	for (i = 0; i < voltages; i++) {
		ret = regulator_list_voltage(regulator, i);
		if (ret >= min_uV && ret <= max_uV)
			return 1;
	}
	return 0;
}