Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: lp872x: Don't set constraints within the regulator driver

Regulator drivers should not be specifying constraints since the valid
configurations depend on how the device is used in a given system, there
is no way to know if a configuration is safe for a given board.

Signed-off-by: Mark Brown <broonie@linaro.org>

-9
-9
drivers/regulator/lp872x.c
··· 845 845 struct device_node *np = dev->of_node; 846 846 struct lp872x_platform_data *pdata; 847 847 struct of_regulator_match *match; 848 - struct regulator_init_data *d; 849 848 int num_matches; 850 849 int count; 851 850 int i; ··· 891 892 pdata->regulator_data[i].id = 892 893 (enum lp872x_regulator_id)match[i].driver_data; 893 894 pdata->regulator_data[i].init_data = match[i].init_data; 894 - 895 - /* Operation mode configuration for buck/buck1/buck2 */ 896 - if (strncmp(match[i].name, "buck", 4)) 897 - continue; 898 - 899 - d = pdata->regulator_data[i].init_data; 900 - d->constraints.valid_modes_mask |= LP872X_VALID_OPMODE; 901 - d->constraints.valid_ops_mask |= REGULATOR_CHANGE_MODE; 902 895 } 903 896 out: 904 897 return pdata;