dect
/
linux-2.6
Archived
13
0
Fork 0

regulator fixed: Do not report enumaratable voltages if there are none

If used as a dummy voltage provider the fixed regulator should
not set n_voltages to make the core accept the device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Sascha Hauer 2012-03-03 12:40:01 +01:00 committed by Mark Brown
parent ab353c2375
commit 1c37f8a838
1 changed files with 3 additions and 1 deletions

View File

@ -192,7 +192,9 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
drvdata->desc.type = REGULATOR_VOLTAGE;
drvdata->desc.owner = THIS_MODULE;
drvdata->desc.ops = &fixed_voltage_ops;
drvdata->desc.n_voltages = 1;
if (config->microvolts)
drvdata->desc.n_voltages = 1;
drvdata->microvolts = config->microvolts;
drvdata->gpio = config->gpio;