aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/s2mps11.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-02-28 11:01:48 +0100
committerMark Brown <broonie@linaro.org>2014-03-03 10:08:54 +0800
commit3119525203149fc11ce9f48131afdf9795d7a4ea (patch)
tree6cc13e7b79f8a5f82fbe1de5cc5cd5644af2fb82 /drivers/regulator/s2mps11.c
parentLinux 3.14-rc2 (diff)
downloadlinux-dev-3119525203149fc11ce9f48131afdf9795d7a4ea.tar.xz
linux-dev-3119525203149fc11ce9f48131afdf9795d7a4ea.zip
regulator: s2mps11: Don't store registered regulators in state container
Regulators registered by devm_regulator_register() do not have to be stored in state container because they are never dereferenced later. The array of regulator_dev can be safely removed from state container. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/s2mps11.c')
-rw-r--r--drivers/regulator/s2mps11.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index cd0b9e35a56d..3647d590b962 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -28,8 +28,6 @@
#define S2MPS11_REGULATOR_CNT ARRAY_SIZE(regulators)
struct s2mps11_info {
- struct regulator_dev *rdev[S2MPS11_REGULATOR_MAX];
-
int ramp_delay2;
int ramp_delay34;
int ramp_delay5;
@@ -439,6 +437,8 @@ common_reg:
config.regmap = iodev->regmap_pmic;
config.driver_data = s2mps11;
for (i = 0; i < S2MPS11_REGULATOR_MAX; i++) {
+ struct regulator_dev *regulator;
+
if (!reg_np) {
config.init_data = pdata->regulators[i].initdata;
config.of_node = pdata->regulators[i].reg_node;
@@ -447,10 +447,10 @@ common_reg:
config.of_node = rdata[i].of_node;
}
- s2mps11->rdev[i] = devm_regulator_register(&pdev->dev,
+ regulator = devm_regulator_register(&pdev->dev,
&regulators[i], &config);
- if (IS_ERR(s2mps11->rdev[i])) {
- ret = PTR_ERR(s2mps11->rdev[i]);
+ if (IS_ERR(regulator)) {
+ ret = PTR_ERR(regulator);
dev_err(&pdev->dev, "regulator init failed for %d\n",
i);
return ret;