diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-21 08:42:23 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-02 23:00:39 -0500 |
commit | 94ee607c961e26f9e09d6e4b4818435b4b61f644 (patch) | |
tree | 152eaabc22c560e3971926aa952f6078658e3701 | |
parent | 93195c33ebe0dd2da1cb0d0cccba2dc50296ae01 (diff) |
regulator: tps65217: 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/tps65217-regulator.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c index fd441f2738f5..10b78d2b766a 100644 --- a/drivers/regulator/tps65217-regulator.c +++ b/drivers/regulator/tps65217-regulator.c | |||
@@ -202,7 +202,7 @@ static struct tps65217_board *tps65217_parse_dt(struct platform_device *pdev) | |||
202 | return NULL; | 202 | return NULL; |
203 | 203 | ||
204 | for (i = 0; i < count; i++) { | 204 | for (i = 0; i < count; i++) { |
205 | if (!reg_matches[i].init_data || !reg_matches[i].of_node) | 205 | if (!reg_matches[i].of_node) |
206 | continue; | 206 | continue; |
207 | 207 | ||
208 | pdata->tps65217_init_data[i] = reg_matches[i].init_data; | 208 | pdata->tps65217_init_data[i] = reg_matches[i].init_data; |
@@ -222,7 +222,6 @@ static int tps65217_regulator_probe(struct platform_device *pdev) | |||
222 | { | 222 | { |
223 | struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); | 223 | struct tps65217 *tps = dev_get_drvdata(pdev->dev.parent); |
224 | struct tps65217_board *pdata = dev_get_platdata(tps->dev); | 224 | struct tps65217_board *pdata = dev_get_platdata(tps->dev); |
225 | struct regulator_init_data *reg_data; | ||
226 | struct regulator_dev *rdev; | 225 | struct regulator_dev *rdev; |
227 | struct regulator_config config = { }; | 226 | struct regulator_config config = { }; |
228 | int i; | 227 | int i; |
@@ -243,19 +242,9 @@ static int tps65217_regulator_probe(struct platform_device *pdev) | |||
243 | platform_set_drvdata(pdev, tps); | 242 | platform_set_drvdata(pdev, tps); |
244 | 243 | ||
245 | for (i = 0; i < TPS65217_NUM_REGULATOR; i++) { | 244 | for (i = 0; i < TPS65217_NUM_REGULATOR; i++) { |
246 | |||
247 | reg_data = pdata->tps65217_init_data[i]; | ||
248 | |||
249 | /* | ||
250 | * Regulator API handles empty constraints but not NULL | ||
251 | * constraints | ||
252 | */ | ||
253 | if (!reg_data) | ||
254 | continue; | ||
255 | |||
256 | /* Register the regulators */ | 245 | /* Register the regulators */ |
257 | config.dev = tps->dev; | 246 | config.dev = tps->dev; |
258 | config.init_data = reg_data; | 247 | config.init_data = pdata->tps65217_init_data[i]; |
259 | config.driver_data = tps; | 248 | config.driver_data = tps; |
260 | config.regmap = tps->regmap; | 249 | config.regmap = tps->regmap; |
261 | if (tps->dev->of_node) | 250 | if (tps->dev->of_node) |