diff options
author | Markus Pargmann <mpa@pengutronix.de> | 2014-10-06 15:33:37 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-20 07:23:41 -0400 |
commit | da0607c8df5c6277ff75468f24e055f193b6b336 (patch) | |
tree | d2bf4f4426a513afef9b83763e4897e85dbc1305 /drivers/regulator/anatop-regulator.c | |
parent | fe08be3ec8672ed92b3ed1b85810df9fa0f98931 (diff) |
regulator: anatop: Fail on invalid voltage selector
A '0' voltage selector is invalid and can't be used with this driver.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/anatop-regulator.c')
-rw-r--r-- | drivers/regulator/anatop-regulator.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 30e8d7ad5813..542d14ed48bb 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c | |||
@@ -291,6 +291,11 @@ static int anatop_regulator_probe(struct platform_device *pdev) | |||
291 | */ | 291 | */ |
292 | if (!sreg->sel && !strcmp(sreg->name, "vddpu")) | 292 | if (!sreg->sel && !strcmp(sreg->name, "vddpu")) |
293 | sreg->sel = 22; | 293 | sreg->sel = 22; |
294 | |||
295 | if (!sreg->sel) { | ||
296 | dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n"); | ||
297 | return -EINVAL; | ||
298 | } | ||
294 | } else { | 299 | } else { |
295 | rdesc->ops = &anatop_rops; | 300 | rdesc->ops = &anatop_rops; |
296 | } | 301 | } |