Skip to content

Commit c368e5f

Browse files
ldewanganbroonie
authored andcommitted
regulator: fixed: get rid of {get|list}_voltage()
Provide the rail supply voltage through descriptor to the core and remove the callbacks which implement the get_voltage and list_voltage. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Signed-off-by: Mark Brown <broonie@linaro.org>
1 parent 5a52360 commit c368e5f

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

‎drivers/regulator/fixed.c‎

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
struct fixed_voltage_data {
3535
struct regulator_desc desc;
3636
struct regulator_dev *dev;
37-
int microvolts;
3837
};
3938

4039

@@ -108,30 +107,7 @@ of_get_fixed_voltage_config(struct device *dev)
108107
return config;
109108
}
110109

111-
static int fixed_voltage_get_voltage(struct regulator_dev *dev)
112-
{
113-
struct fixed_voltage_data *data = rdev_get_drvdata(dev);
114-
115-
if (data->microvolts)
116-
return data->microvolts;
117-
else
118-
return -EINVAL;
119-
}
120-
121-
static int fixed_voltage_list_voltage(struct regulator_dev *dev,
122-
unsigned selector)
123-
{
124-
struct fixed_voltage_data *data = rdev_get_drvdata(dev);
125-
126-
if (selector != 0)
127-
return -EINVAL;
128-
129-
return data->microvolts;
130-
}
131-
132110
static struct regulator_ops fixed_voltage_ops = {
133-
.get_voltage = fixed_voltage_get_voltage,
134-
.list_voltage = fixed_voltage_list_voltage,
135111
};
136112

137113
static int reg_fixed_voltage_probe(struct platform_device *pdev)
@@ -186,7 +162,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
186162
if (config->microvolts)
187163
drvdata->desc.n_voltages = 1;
188164

189-
drvdata->microvolts = config->microvolts;
165+
drvdata->desc.fixed_uV = config->microvolts;
190166

191167
if (config->gpio >= 0)
192168
cfg.ena_gpio = config->gpio;
@@ -222,7 +198,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
222198
platform_set_drvdata(pdev, drvdata);
223199

224200
dev_dbg(&pdev->dev, "%s supplying %duV\n", drvdata->desc.name,
225-
drvdata->microvolts);
201+
drvdata->desc.fixed_uV);
226202

227203
return 0;
228204

0 commit comments

Comments
 (0)