]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: ehci-mx6: Handle fixed regulators correctly
authorMarek Vasut <marex@denx.de>
Thu, 21 May 2020 21:32:23 +0000 (23:32 +0200)
committerMarek Vasut <marex@denx.de>
Fri, 29 May 2020 17:18:55 +0000 (19:18 +0200)
The regulator-fixed would return -ENOSYS when enabled/disabled,
because this operation is not supported, but this is not an error
e.g. on systems where the VBUS cannot be controlled, so if this
is the error code reported by the regulator core, consider it a
success and continue.

Signed-off-by: Marek Vasut <marex@denx.de>
drivers/usb/host/ehci-mx6.c

index 24f8ad7af84a229527ac75811e443af0e994e778..470eddd0c9e4b226d0e3484556b07fd682bba46d 100644 (file)
@@ -447,7 +447,7 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
                ret = regulator_set_enable(priv->vbus_supply,
                                           (type == USB_INIT_DEVICE) ?
                                           false : true);
-               if (ret) {
+               if (ret && ret != -ENOSYS) {
                        puts("Error enabling VBUS supply\n");
                        return ret;
                }
@@ -614,7 +614,7 @@ static int ehci_usb_probe(struct udevice *dev)
                ret = regulator_set_enable(priv->vbus_supply,
                                           (type == USB_INIT_DEVICE) ?
                                           false : true);
-               if (ret) {
+               if (ret && ret != -ENOSYS) {
                        puts("Error enabling VBUS supply\n");
                        return ret;
                }