]> git.baikalelectronics.ru Git - uboot.git/commitdiff
usb: dwc3: Fix non-usb3 configurations
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 25 Apr 2022 11:26:45 +0000 (13:26 +0200)
committerMarek Vasut <marex@denx.de>
Fri, 20 May 2022 21:30:36 +0000 (23:30 +0200)
Missing nodes may also be signaled via -ENODATA. We need to check for
that to prevent failing in non-usb3 setups.

Furthermore, dev.phy must be NULL'ed in case usb3-phy was not found.

Fixes: 9c4f68892650 ("usb: dwc3: Add support for usb3-phy PHY configuration")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
drivers/usb/dwc3/dwc3-generic.c

index 6e1a1d066b4068a37cf96f432ed0a37f85787ba7..c5310e465cbf463f99ca9d23425146d7e5617493 100644 (file)
@@ -468,9 +468,11 @@ static int dwc3_glue_probe(struct udevice *dev)
                ret = generic_phy_init(&phy);
                if (ret)
                        return ret;
-       } else if (ret != -ENOENT) {
+       } else if (ret != -ENOENT && ret != -ENODATA) {
                debug("could not get phy (err %d)\n", ret);
                return ret;
+       } else {
+               phy.dev = NULL;
        }
 
        glue->regs = dev_read_addr(dev);