summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-03 19:49:55 +0200
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 14:32:40 +0200
commitf25e0b4fcc38d120e704c377791158c4b2a54daa (patch)
tree6547268eaf41ad2f987519ec71c0c346fe8868e0 /drivers/regulator
parentregulator: Check for constraints before using them for name (diff)
downloadlinux-f25e0b4fcc38d120e704c377791158c4b2a54daa.tar.xz
linux-f25e0b4fcc38d120e704c377791158c4b2a54daa.zip
regulator: Check for constraints in regulator_init_complete()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6e0c723371d8..dfbf4312ec34 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2409,14 +2409,14 @@ static int __init regulator_init_complete(void)
ops = rdev->desc->ops;
c = rdev->constraints;
- if (c->name)
+ if (c && c->name)
name = c->name;
else if (rdev->desc->name)
name = rdev->desc->name;
else
name = "regulator";
- if (!ops->disable || c->always_on)
+ if (!ops->disable || (c && c->always_on))
continue;
mutex_lock(&rdev->mutex);