diff mbox series

[v3,2/2] usb: dwc3: Fix enabling USB_DR_MODE_HOST

Message ID 20230825104251.28311-2-oleksandr.suvorov@foundries.io
State Accepted
Commit 7f4b73fe6939761dd3891b96628efcab47a0570e
Delegated to: Marek Vasut
Headers show
Series [v3,1/2] usb: dwc3: Fix renaming SPL_USB_HOST_SUPPORT to SPL_USB_HOST | expand

Commit Message

Oleksandr Suvorov Aug. 25, 2023, 10:42 a.m. UTC
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>
---

Changes in v3:
- fix original logic of choosing a host operation mode

Changes in v2:
- shrink the code using CONFIG_IS_ENABLED()

 drivers/usb/dwc3/dwc3-layerscape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-layerscape.c b/drivers/usb/dwc3/dwc3-layerscape.c
index 58baa017ad1..c32df2396d7 100644
--- a/drivers/usb/dwc3/dwc3-layerscape.c
+++ b/drivers/usb/dwc3/dwc3-layerscape.c
@@ -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";