Commit f5500ecc authored by Dinh Nguyen's avatar Dinh Nguyen Committed by Felipe Balbi

usb: dwc2: move usb_disabled() call to host driver only

Since platform.c will get built for both Host and Gadget, if we leave the
usb_disabled() call in platform.c, it results in the following build error
when (!USB && USB_GADGET) condition is met.

ERROR: "usb_disabled" [drivers/usb/dwc2/dwc2_platform.ko] undefined!

Since usb_disabled() is mostly used to disable USB host functionality, move
the call the host portion for the DWC2 driver.
Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarDinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 8d736d8a
...@@ -2846,6 +2846,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq, ...@@ -2846,6 +2846,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
int i, num_channels; int i, num_channels;
int retval; int retval;
if (usb_disabled())
return -ENODEV;
dev_dbg(hsotg->dev, "DWC OTG HCD INIT\n"); dev_dbg(hsotg->dev, "DWC OTG HCD INIT\n");
/* Detect config values from hardware */ /* Detect config values from hardware */
......
...@@ -157,9 +157,6 @@ static int dwc2_driver_probe(struct platform_device *dev) ...@@ -157,9 +157,6 @@ static int dwc2_driver_probe(struct platform_device *dev)
int retval; int retval;
int irq; int irq;
if (usb_disabled())
return -ENODEV;
match = of_match_device(dwc2_of_match_table, &dev->dev); match = of_match_device(dwc2_of_match_table, &dev->dev);
if (match && match->data) { if (match && match->data) {
params = match->data; params = match->data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment