summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-03-03 12:40:01 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-11 21:48:51 +0100
commit1c37f8a838fa8b1e98a984893bd4f1a8a9849421 (patch)
treebba5a8d8725227b01a742243c7592ac34ba821af /drivers
parentregulator: max8660: Use DIV_ROUND_UP macro to calculate selector (diff)
downloadlinux-1c37f8a838fa8b1e98a984893bd4f1a8a9849421.tar.xz
linux-1c37f8a838fa8b1e98a984893bd4f1a8a9849421.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/fixed.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index e24e3a174c4b..40f38030b394 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -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;