diff options
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/anatop-regulator.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 5b5ab0a3ec84..76806f9e06cf 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -241,6 +241,12 @@ static int anatop_regulator_probe(struct platform_device *pdev) if (!sreg) return -ENOMEM; sreg->name = of_get_property(np, "regulator-name", NULL); + + if (!sreg->name) { + dev_err(dev, "no regulator-name set\n"); + return -EINVAL; + } + rdesc = &sreg->rdesc; rdesc->name = sreg->name; rdesc->type = REGULATOR_VOLTAGE; |