summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-03 18:49:54 +0100
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-09-22 13:32:40 +0100
commitb39480ac37951de126455991744c9dbb61bbb839 (patch)
tree67e44b051e3e4d4798733065c9aac6ad0f43318b /drivers/regulator
parentc53ad7fe5759cea10137c9e176d14f8c8f22d286 (diff)
downloadkernel-crypto-b39480ac37951de126455991744c9dbb61bbb839.tar.gz
kernel-crypto-b39480ac37951de126455991744c9dbb61bbb839.tar.xz
kernel-crypto-b39480ac37951de126455991744c9dbb61bbb839.zip
regulator: Check for constraints before using them for name
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e38db55600e..6e0c723371d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -232,7 +232,7 @@ static ssize_t regulator_name_show(struct device *dev,
struct regulator_dev *rdev = dev_get_drvdata(dev);
const char *name;
- if (rdev->constraints->name)
+ if (rdev->constraints && rdev->constraints->name)
name = rdev->constraints->name;
else if (rdev->desc->name)
name = rdev->desc->name;