diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-18 08:11:48 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-16 17:53:19 -0400 |
commit | 23b1134838efdb5872be7b75e86fae41e60ba629 (patch) | |
tree | 3edf1f348bdc1e2b37a7b1087ea73407aff7487a | |
parent | 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9 (diff) |
regulator: tps65910: Allow missing init_data for diagnostics
The regulator core supports this to allow the configuration to be inspected
at runtime even if no software management is enabled.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/tps65910-regulator.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index fa7db8847578..20645070b779 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c | |||
@@ -1047,7 +1047,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( | |||
1047 | *tps65910_reg_matches = matches; | 1047 | *tps65910_reg_matches = matches; |
1048 | 1048 | ||
1049 | for (idx = 0; idx < count; idx++) { | 1049 | for (idx = 0; idx < count; idx++) { |
1050 | if (!matches[idx].init_data || !matches[idx].of_node) | 1050 | if (!matches[idx].of_node) |
1051 | continue; | 1051 | continue; |
1052 | 1052 | ||
1053 | pmic_plat_data->tps65910_pmic_init_data[idx] = | 1053 | pmic_plat_data->tps65910_pmic_init_data[idx] = |
@@ -1077,7 +1077,6 @@ static int tps65910_probe(struct platform_device *pdev) | |||
1077 | struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent); | 1077 | struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent); |
1078 | struct regulator_config config = { }; | 1078 | struct regulator_config config = { }; |
1079 | struct tps_info *info; | 1079 | struct tps_info *info; |
1080 | struct regulator_init_data *reg_data; | ||
1081 | struct regulator_dev *rdev; | 1080 | struct regulator_dev *rdev; |
1082 | struct tps65910_reg *pmic; | 1081 | struct tps65910_reg *pmic; |
1083 | struct tps65910_board *pmic_plat_data; | 1082 | struct tps65910_board *pmic_plat_data; |
@@ -1140,14 +1139,6 @@ static int tps65910_probe(struct platform_device *pdev) | |||
1140 | 1139 | ||
1141 | for (i = 0; i < pmic->num_regulators && i < TPS65910_NUM_REGS; | 1140 | for (i = 0; i < pmic->num_regulators && i < TPS65910_NUM_REGS; |
1142 | i++, info++) { | 1141 | i++, info++) { |
1143 | |||
1144 | reg_data = pmic_plat_data->tps65910_pmic_init_data[i]; | ||
1145 | |||
1146 | /* Regulator API handles empty constraints but not NULL | ||
1147 | * constraints */ | ||
1148 | if (!reg_data) | ||
1149 | continue; | ||
1150 | |||
1151 | /* Register the regulators */ | 1142 | /* Register the regulators */ |
1152 | pmic->info[i] = info; | 1143 | pmic->info[i] = info; |
1153 | 1144 | ||
@@ -1199,7 +1190,7 @@ static int tps65910_probe(struct platform_device *pdev) | |||
1199 | pmic->desc[i].enable_mask = TPS65910_SUPPLY_STATE_ENABLED; | 1190 | pmic->desc[i].enable_mask = TPS65910_SUPPLY_STATE_ENABLED; |
1200 | 1191 | ||
1201 | config.dev = tps65910->dev; | 1192 | config.dev = tps65910->dev; |
1202 | config.init_data = reg_data; | 1193 | config.init_data = pmic_plat_data->tps65910_pmic_init_data[i]; |
1203 | config.driver_data = pmic; | 1194 | config.driver_data = pmic; |
1204 | config.regmap = tps65910->regmap; | 1195 | config.regmap = tps65910->regmap; |
1205 | 1196 | ||