]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: onboard-hub: Fix the return values of regulator APIs
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Mon, 25 Nov 2024 04:11:59 +0000 (09:41 +0530)
committerMarek Vasut <marex@denx.de>
Mon, 25 Nov 2024 04:40:49 +0000 (05:40 +0100)
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>
common/usb_onboard_hub.c

index e4d1f12cb47ef977d1d488765ede989067a5cf34..812e7749de5247af4e8200334d2ef9a40ed45436 100644 (file)
@@ -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);
 }