usb: dwc3: Fix enabling USB_DR_MODE_HOST
authorOleksandr Suvorov <oleksandr.suvorov@foundries.io>
Fri, 25 Aug 2023 10:42:40 +0000 (13:42 +0300)
committerMarek Vasut <marex@denx.de>
Mon, 4 Sep 2023 13:51:38 +0000 (15:51 +0200)
The original logic always enables USB_DR_MODE_HOST operation mode in
dwc3_layerscape_bind() in u-boot. Prevent choosing USB_DR_MODE_HOST
operation mode if USB_HOST is not enabled.

Fixes: 2b0b51d0bed ("usb: dwc3: add layerscape support")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
drivers/usb/dwc3/dwc3-layerscape.c

index 58baa01..c32df23 100644 (file)
@@ -193,7 +193,7 @@ static int dwc3_layerscape_bind(struct udevice *dev)
                driver = "dwc3-layerscape-peripheral";
                break;
 #endif
-#if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD)
+#if CONFIG_IS_ENABLED(USB_HOST)
        case USB_DR_MODE_HOST:
                dev_dbg(dev, "Using host mode\n");
                driver = "dwc3-layerscape-host";