diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-06 01:47:41 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-11 07:26:24 -0500 |
commit | f7e9e52f7d29dd24c8d3fd3c5939218197972e4f (patch) | |
tree | a7751da55c775eba5eb49830c960e60790159db2 | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
regulator: as3711: 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/as3711-regulator.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/regulator/as3711-regulator.c b/drivers/regulator/as3711-regulator.c index c77a58478cca..67fd548dcdba 100644 --- a/drivers/regulator/as3711-regulator.c +++ b/drivers/regulator/as3711-regulator.c | |||
@@ -221,7 +221,6 @@ static int as3711_regulator_probe(struct platform_device *pdev) | |||
221 | { | 221 | { |
222 | struct as3711_regulator_pdata *pdata = dev_get_platdata(&pdev->dev); | 222 | struct as3711_regulator_pdata *pdata = dev_get_platdata(&pdev->dev); |
223 | struct as3711 *as3711 = dev_get_drvdata(pdev->dev.parent); | 223 | struct as3711 *as3711 = dev_get_drvdata(pdev->dev.parent); |
224 | struct regulator_init_data *reg_data; | ||
225 | struct regulator_config config = {.dev = &pdev->dev,}; | 224 | struct regulator_config config = {.dev = &pdev->dev,}; |
226 | struct as3711_regulator *reg = NULL; | 225 | struct as3711_regulator *reg = NULL; |
227 | struct as3711_regulator *regs; | 226 | struct as3711_regulator *regs; |
@@ -252,16 +251,10 @@ static int as3711_regulator_probe(struct platform_device *pdev) | |||
252 | } | 251 | } |
253 | 252 | ||
254 | for (id = 0, ri = as3711_reg_info; id < AS3711_REGULATOR_NUM; ++id, ri++) { | 253 | for (id = 0, ri = as3711_reg_info; id < AS3711_REGULATOR_NUM; ++id, ri++) { |
255 | reg_data = pdata->init_data[id]; | ||
256 | |||
257 | /* No need to register if there is no regulator data */ | ||
258 | if (!reg_data) | ||
259 | continue; | ||
260 | |||
261 | reg = ®s[id]; | 254 | reg = ®s[id]; |
262 | reg->reg_info = ri; | 255 | reg->reg_info = ri; |
263 | 256 | ||
264 | config.init_data = reg_data; | 257 | config.init_data = pdata->init_data[id]; |
265 | config.driver_data = reg; | 258 | config.driver_data = reg; |
266 | config.regmap = as3711->regmap; | 259 | config.regmap = as3711->regmap; |
267 | config.of_node = of_node[id]; | 260 | config.of_node = of_node[id]; |