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

regulator: aat2870: Convert to regulator_list_voltage_table

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Axel Lin and committed by
Mark Brown
4506c6d5 e76b9cc7

+3 -13
+3 -13
drivers/regulator/aat2870-regulator.c
··· 33 33 struct aat2870_data *aat2870; 34 34 struct regulator_desc desc; 35 35 36 - const int *voltages; /* uV */ 37 - 38 36 int min_uV; 39 37 int max_uV; 40 38 ··· 44 46 u8 voltage_shift; 45 47 u8 voltage_mask; 46 48 }; 47 - 48 - static int aat2870_ldo_list_voltage(struct regulator_dev *rdev, 49 - unsigned selector) 50 - { 51 - struct aat2870_regulator *ri = rdev_get_drvdata(rdev); 52 - 53 - return ri->voltages[selector]; 54 - } 55 49 56 50 static int aat2870_ldo_set_voltage_sel(struct regulator_dev *rdev, 57 51 unsigned selector) ··· 101 111 } 102 112 103 113 static struct regulator_ops aat2870_ldo_ops = { 104 - .list_voltage = aat2870_ldo_list_voltage, 114 + .list_voltage = regulator_list_voltage_table, 105 115 .set_voltage_sel = aat2870_ldo_set_voltage_sel, 106 116 .get_voltage_sel = aat2870_ldo_get_voltage_sel, 107 117 .enable = aat2870_ldo_enable, ··· 109 119 .is_enabled = aat2870_ldo_is_enabled, 110 120 }; 111 121 112 - static const int aat2870_ldo_voltages[] = { 122 + static const unsigned int aat2870_ldo_voltages[] = { 113 123 1200000, 1300000, 1500000, 1600000, 114 124 1800000, 2000000, 2200000, 2500000, 115 125 2600000, 2700000, 2800000, 2900000, ··· 122 132 .name = #ids, \ 123 133 .id = AAT2870_ID_##ids, \ 124 134 .n_voltages = ARRAY_SIZE(aat2870_ldo_voltages), \ 135 + .volt_table = aat2870_ldo_voltages, \ 125 136 .ops = &aat2870_ldo_ops, \ 126 137 .type = REGULATOR_VOLTAGE, \ 127 138 .owner = THIS_MODULE, \ 128 139 }, \ 129 - .voltages = aat2870_ldo_voltages, \ 130 140 .min_uV = 1200000, \ 131 141 .max_uV = 3300000, \ 132 142 }