From: Markus Pargmann Date: Mon, 6 Oct 2014 19:33:37 +0000 (+0200) Subject: regulator: anatop: Fail on invalid voltage selector X-Git-Tag: v3.19-rc1~178^2~3^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=da0607c8df5c6277ff75468f24e055f193b6b336;p=karo-tx-linux.git 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 Signed-off-by: Mark Brown --- 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) */ if (!sreg->sel && !strcmp(sreg->name, "vddpu")) sreg->sel = 22; + + if (!sreg->sel) { + dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n"); + return -EINVAL; + } } else { rdesc->ops = &anatop_rops; }