Skip to content

Commit

Permalink
regulator: Check for constraints in regulator_init_complete()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Sep 22, 2009
1 parent b39480a commit f25e0b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f25e0b4

Please sign in to comment.