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

regulator: tps6524x: Remove *rdev[N_REGULATORS] from struct tps6524x

Current code is using devm_regulator_register() so we don't need to store
*rdev for clean up, use a local variable instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Axel Lin and committed by
Mark Brown
7a8b0e66 357db027

+4 -5
+4 -5
drivers/regulator/tps6524x-regulator.c
··· 137 137 struct spi_device *spi; 138 138 struct mutex lock; 139 139 struct regulator_desc desc[N_REGULATORS]; 140 - struct regulator_dev *rdev[N_REGULATORS]; 141 140 }; 142 141 143 142 static int __read_reg(struct tps6524x *hw, int reg) ··· 583 584 const struct supply_info *info = supply_info; 584 585 struct regulator_init_data *init_data; 585 586 struct regulator_config config = { }; 587 + struct regulator_dev *rdev; 586 588 int i; 587 589 588 590 init_data = dev_get_platdata(dev); ··· 616 616 config.init_data = init_data; 617 617 config.driver_data = hw; 618 618 619 - hw->rdev[i] = devm_regulator_register(dev, &hw->desc[i], 620 - &config); 621 - if (IS_ERR(hw->rdev[i])) 622 - return PTR_ERR(hw->rdev[i]); 619 + rdev = devm_regulator_register(dev, &hw->desc[i], &config); 620 + if (IS_ERR(rdev)) 621 + return PTR_ERR(rdev); 623 622 } 624 623 625 624 return 0;