summaryrefslogtreecommitdiff
path: root/drivers/regulator/tps65023-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-05-12 09:47:50 +0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-05-27 13:49:09 +0400
commit77fa44d0e10711e899788c58fe53f8f7b18c7f67 (patch)
treefb2a0313778dd0ade523162506af3a0835e2ccc3 /drivers/regulator/tps65023-regulator.c
parentc01e36dde4632e0a7474fddf0716f1e54f01f13e (diff)
downloadlinux-77fa44d0e10711e899788c58fe53f8f7b18c7f67.tar.xz
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>
Diffstat (limited to 'drivers/regulator/tps65023-regulator.c')
-rw-r--r--drivers/regulator/tps65023-regulator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c
index 60a7ca5409e9..fbddc15e1811 100644
--- a/drivers/regulator/tps65023-regulator.c
+++ b/drivers/regulator/tps65023-regulator.c
@@ -466,7 +466,6 @@ static struct regulator_ops tps65023_ldo_ops = {
static int __devinit tps_65023_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
- static int desc_id;
const struct tps_info *info = (void *)id->driver_data;
struct regulator_init_data *init_data;
struct regulator_dev *rdev;
@@ -499,7 +498,7 @@ static int __devinit tps_65023_probe(struct i2c_client *client,
tps->info[i] = info;
tps->desc[i].name = info->name;
- tps->desc[i].id = desc_id++;
+ tps->desc[i].id = i;
tps->desc[i].n_voltages = num_voltages[i];
tps->desc[i].ops = (i > TPS65023_DCDC_3 ?
&tps65023_ldo_ops : &tps65023_dcdc_ops);