Commit 7f40e8b2 authored by Mark Brown's avatar Mark Brown Committed by Liam Girdwood

regulator: Check for constraints before using them for name

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 01c41469
...@@ -232,7 +232,7 @@ static ssize_t regulator_name_show(struct device *dev, ...@@ -232,7 +232,7 @@ static ssize_t regulator_name_show(struct device *dev,
struct regulator_dev *rdev = dev_get_drvdata(dev); struct regulator_dev *rdev = dev_get_drvdata(dev);
const char *name; const char *name;
if (rdev->constraints->name) if (rdev->constraints && rdev->constraints->name)
name = rdev->constraints->name; name = rdev->constraints->name;
else if (rdev->desc->name) else if (rdev->desc->name)
name = rdev->desc->name; name = rdev->desc->name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment