power: io-domain: fix err handle for regulator get

Change-Id: I7c8d760676c15776df35708bf4d35552da0cf96b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
Jianqun Xu 2020-03-27 15:17:53 +08:00
parent 594e14a437
commit 96a4cf48b5
1 changed files with 6 additions and 8 deletions

View File

@ -518,20 +518,18 @@ static int rockchip_iodomain_probe(struct udevice *dev)
continue; continue;
reg = of_get_regulator(dev_ofnode(dev), supply_name); reg = of_get_regulator(dev_ofnode(dev), supply_name);
if (!reg) { if (!reg)
printf("could not find regulator %s\n", supply_name); continue;
return -1;
}
uV = regulator_get_value(reg); uV = regulator_get_value(reg);
if (uV < 0) { if (uV <= 0) {
printf("could not get voltage from %s\n", reg->name); printf("voltage(%d uV) is invalid from %s\n", uV, reg->name);
return -1; continue;
} }
if (uV > MAX_VOLTAGE_3_3) { if (uV > MAX_VOLTAGE_3_3) {
printf("%d uV is too high from %s\n", uV, reg->name); printf("%d uV is too high from %s\n", uV, reg->name);
return -1; continue;
} }
/* setup our supply */ /* setup our supply */