Skip to content

Commit

Permalink
usb: dwc2: move usb_disabled() call to host driver only
Browse files Browse the repository at this point in the history
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: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Dinh Nguyen authored and Felipe Balbi committed Nov 14, 2014
1 parent 8d736d8 commit f5500ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/dwc2/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2846,6 +2846,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
int i, num_channels;
int retval;

if (usb_disabled())
return -ENODEV;

dev_dbg(hsotg->dev, "DWC OTG HCD INIT\n");

/* Detect config values from hardware */
Expand Down
3 changes: 0 additions & 3 deletions drivers/usb/dwc2/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@ static int dwc2_driver_probe(struct platform_device *dev)
int retval;
int irq;

if (usb_disabled())
return -ENODEV;

match = of_match_device(dwc2_of_match_table, &dev->dev);
if (match && match->data) {
params = match->data;
Expand Down

0 comments on commit f5500ec

Please sign in to comment.