aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 e38db55600e0..6e0c723371d8 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -232,7 +232,7 @@ static ssize_t regulator_name_show(struct device *dev,
232 struct regulator_dev *rdev = dev_get_drvdata(dev); 232 struct regulator_dev *rdev = dev_get_drvdata(dev);
233 const char *name; 233 const char *name;
234 234
235 if (rdev->constraints->name) 235 if (rdev->constraints && rdev->constraints->name)
236 name = rdev->constraints->name; 236 name = rdev->constraints->name;
237 else if (rdev->desc->name) 237 else if (rdev->desc->name)
238 name = rdev->desc->name; 238 name = rdev->desc->name;