Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Mark Brown
fb8eb454 5ee77ef2

+5 -8
+5 -8
drivers/regulator/act8865-regulator.c
··· 62 62 #define ACT8865_VOLTAGE_NUM 64 63 63 64 64 struct act8865 { 65 - struct regulator_dev *rdev[ACT8865_REG_NUM]; 66 65 struct regmap *regmap; 67 66 }; 68 67 ··· 255 256 static int act8865_pmic_probe(struct i2c_client *client, 256 257 const struct i2c_device_id *i2c_id) 257 258 { 258 - struct regulator_dev **rdev; 259 + struct regulator_dev *rdev; 259 260 struct device *dev = &client->dev; 260 261 struct act8865_platform_data *pdata = dev_get_platdata(dev); 261 262 struct regulator_config config = { }; ··· 289 290 if (!act8865) 290 291 return -ENOMEM; 291 292 292 - rdev = act8865->rdev; 293 - 294 293 act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config); 295 294 if (IS_ERR(act8865->regmap)) { 296 295 error = PTR_ERR(act8865->regmap); ··· 308 311 config.driver_data = act8865; 309 312 config.regmap = act8865->regmap; 310 313 311 - rdev[i] = devm_regulator_register(&client->dev, 312 - &act8865_reg[i], &config); 313 - if (IS_ERR(rdev[i])) { 314 + rdev = devm_regulator_register(&client->dev, &act8865_reg[i], 315 + &config); 316 + if (IS_ERR(rdev)) { 314 317 dev_err(dev, "failed to register %s\n", 315 318 act8865_reg[id].name); 316 - return PTR_ERR(rdev[i]); 319 + return PTR_ERR(rdev); 317 320 } 318 321 } 319 322