]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: tps6507x: Remove num_voltages array
authorAxel Lin <axel.lin@gmail.com>
Tue, 2 Aug 2011 07:34:12 +0000 (15:34 +0800)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Mon, 8 Aug 2011 16:15:09 +0000 (17:15 +0100)
We can get n_voltages for each regulator from table_len of struct tps_info.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/tps6507x-regulator.c

index bfffabc21edabdffe051466b9d11b9fd60890400..bdef70365f52b5c1c01ae30cd66d194d31c820ac 100644 (file)
@@ -90,12 +90,6 @@ static const u16 LDO2_VSEL_table[] = {
        3000, 3100, 3200, 3300,
 };
 
-static unsigned int num_voltages[] = {ARRAY_SIZE(VDCDCx_VSEL_table),
-                               ARRAY_SIZE(VDCDCx_VSEL_table),
-                               ARRAY_SIZE(VDCDCx_VSEL_table),
-                               ARRAY_SIZE(LDO1_VSEL_table),
-                               ARRAY_SIZE(LDO2_VSEL_table)};
-
 struct tps_info {
        const char *name;
        unsigned min_uV;
@@ -598,7 +592,7 @@ int tps6507x_pmic_probe(struct platform_device *pdev)
 
                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 > TPS6507X_DCDC_3 ?
                &tps6507x_pmic_ldo_ops : &tps6507x_pmic_dcdc_ops);
                tps->desc[i].type = REGULATOR_VOLTAGE;