regulator: Fix desc_id for tps65023/6507x/65910
The desc_id variable should not be a static variable.
The rest of the code assumes the desc_id must less than TPSxxxxx_NUM_REGULATOR.
If we set desc_id to be a static variable, checking the return value of
rdev_get_id() may return error.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Anuj Aggarwal <anuj.aggarwal@ti.com>
Cc: Graeme Gregory <gg@slimlogic.co.uk>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index d461fa7..048ba47 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -604,7 +604,6 @@
struct regulator_dev *rdev;
struct tps65910_reg *pmic;
struct tps65910_board *pmic_plat_data;
- static int desc_id;
int i, err;
pmic_plat_data = dev_get_platdata(tps65910->dev);
@@ -630,7 +629,7 @@
pmic->info[i] = info;
pmic->desc[i].name = info->name;
- pmic->desc[i].id = desc_id++;
+ pmic->desc[i].id = i;
pmic->desc[i].n_voltages = info->table_len;
if ((i == TPS65910_REG_VDD1) || (i == TPS65910_REG_VDD2))