diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-03-08 08:19:07 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-10 06:30:21 -0400 |
commit | fb8eb454005ad8a04da16c7867fbdb41d727a46b (patch) | |
tree | a591ccb6cd757339d25839dddd787a33d26a5141 | |
parent | 5ee77ef27e4fb1cdc2b4f17c362e8a0c9245dc89 (diff) |
regulator: act8865: Remove unnecessary *rdev[] from struct act8865
Now we are using devm_regulator_register(), so we don't need the *rdev[] array
to store return value of devm_regulator_register. Use a *rdev variable is
enough for checking return status.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Wenyou Yang <Wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/act8865-regulator.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c index a5ff30c8a1e3..b92d7dd01a18 100644 --- a/drivers/regulator/act8865-regulator.c +++ b/drivers/regulator/act8865-regulator.c | |||
@@ -62,7 +62,6 @@ | |||
62 | #define ACT8865_VOLTAGE_NUM 64 | 62 | #define ACT8865_VOLTAGE_NUM 64 |
63 | 63 | ||
64 | struct act8865 { | 64 | struct act8865 { |
65 | struct regulator_dev *rdev[ACT8865_REG_NUM]; | ||
66 | struct regmap *regmap; | 65 | struct regmap *regmap; |
67 | }; | 66 | }; |
68 | 67 | ||
@@ -256,7 +255,7 @@ static inline int act8865_pdata_from_dt(struct device *dev, | |||
256 | static int act8865_pmic_probe(struct i2c_client *client, | 255 | static int act8865_pmic_probe(struct i2c_client *client, |
257 | const struct i2c_device_id *i2c_id) | 256 | const struct i2c_device_id *i2c_id) |
258 | { | 257 | { |
259 | struct regulator_dev **rdev; | 258 | struct regulator_dev *rdev; |
260 | struct device *dev = &client->dev; | 259 | struct device *dev = &client->dev; |
261 | struct act8865_platform_data *pdata = dev_get_platdata(dev); | 260 | struct act8865_platform_data *pdata = dev_get_platdata(dev); |
262 | struct regulator_config config = { }; | 261 | struct regulator_config config = { }; |
@@ -290,8 +289,6 @@ static int act8865_pmic_probe(struct i2c_client *client, | |||
290 | if (!act8865) | 289 | if (!act8865) |
291 | return -ENOMEM; | 290 | return -ENOMEM; |
292 | 291 | ||
293 | rdev = act8865->rdev; | ||
294 | |||
295 | act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config); | 292 | act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config); |
296 | if (IS_ERR(act8865->regmap)) { | 293 | if (IS_ERR(act8865->regmap)) { |
297 | error = PTR_ERR(act8865->regmap); | 294 | error = PTR_ERR(act8865->regmap); |
@@ -311,12 +308,12 @@ static int act8865_pmic_probe(struct i2c_client *client, | |||
311 | config.driver_data = act8865; | 308 | config.driver_data = act8865; |
312 | config.regmap = act8865->regmap; | 309 | config.regmap = act8865->regmap; |
313 | 310 | ||
314 | rdev[i] = devm_regulator_register(&client->dev, | 311 | rdev = devm_regulator_register(&client->dev, &act8865_reg[i], |
315 | &act8865_reg[i], &config); | 312 | &config); |
316 | if (IS_ERR(rdev[i])) { | 313 | if (IS_ERR(rdev)) { |
317 | dev_err(dev, "failed to register %s\n", | 314 | dev_err(dev, "failed to register %s\n", |
318 | act8865_reg[id].name); | 315 | act8865_reg[id].name); |
319 | return PTR_ERR(rdev[i]); | 316 | return PTR_ERR(rdev); |
320 | } | 317 | } |
321 | } | 318 | } |
322 | 319 | ||