Skip to content

Commit

Permalink
regulator fixed: Do not report enumaratable voltages if there are none
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sascha Hauer authored and Mark Brown committed Mar 11, 2012
1 parent ab353c2 commit 1c37f8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/regulator/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c37f8a

Please sign in to comment.