mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 18:04:48 +00:00
usb: onboard-hub: Fix the return values of regulator APIs
Don't error out if there is no vdd regulator supply, as these are optional properties. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Reviewed-by: Marek Vasut <marex@denx.de>
This commit is contained in:
parent
0e670e2917
commit
5fdce1fa17
1 changed files with 8 additions and 4 deletions
|
@ -57,14 +57,18 @@ static int usb_onboard_hub_probe(struct udevice *dev)
|
|||
int ret;
|
||||
|
||||
ret = device_get_supply_regulator(dev, "vdd-supply", &hub->vdd);
|
||||
if (ret) {
|
||||
if (ret && ret != -ENOENT) {
|
||||
dev_err(dev, "can't get vdd-supply: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = regulator_set_enable_if_allowed(hub->vdd, true);
|
||||
if (ret)
|
||||
dev_err(dev, "can't enable vdd-supply: %d\n", ret);
|
||||
if (hub->vdd) {
|
||||
ret = regulator_set_enable_if_allowed(hub->vdd, true);
|
||||
if (ret && ret != -ENOSYS) {
|
||||
dev_err(dev, "can't enable vdd-supply: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return usb_onboard_hub_reset(dev);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue