Skip to contentSkip to conversation

regulator: tps65023: Remove num_voltages array

PATCH RESEND In review Axel Lin 1 participant 2 messages Aug 29, 2011 – Aug 30, 2011 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND v2 1/1 regulator: tps65023: Remove num_voltages array

We can get n_voltages for each regulator from table_len of struct tps_info.

---
 drivers/regulator/tps65023-regulator.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/regulator/tps65023-regulator.c +1 -5
index 701a590..3d2a81a 100644
@@ -106,10 +106,6 @@ static const u16 LDO2_VSEL_table[] = {
 	2500, 2800, 3000, 3300,
 };
 
-static unsigned int num_voltages[] = {ARRAY_SIZE(VDCDC1_VSEL_table),
-				0, 0, ARRAY_SIZE(LDO1_VSEL_table),
-				ARRAY_SIZE(LDO2_VSEL_table)};
-
 /* Regulator specific details */
 struct tps_info {
 	const char *name;
@@ -453,7 +449,7 @@ static int __devinit tps_65023_probe(struct i2c_client *client,
 
 		tps->desc[i].name = info->name;
 		tps->desc[i].id = i;
-		tps->desc[i].n_voltages = num_voltages[i];
+		tps->desc[i].n_voltages = info->table_len;
 		tps->desc[i].ops = (i > TPS65023_DCDC_3 ?
 					&tps65023_ldo_ops : &tps65023_dcdc_ops);
 		tps->desc[i].type = REGULATOR_VOLTAGE;
Signature · 1 line
1.7.4.1
author
#1 lore raw

2011/8/29 Axel Lin <[email protected]>:

Quoted 2 lines

We can get n_voltages for each regulator from table_len of struct tps_info.

hi Liam,
Please ignore this one.
I just found it is already include in
commit 1c3ede05d1 "regulator: tps65023: Setting correct core regulator for tps65021"

Thanks,
Axel