diff options
author | Dinh Nguyen <dinguyen@opensource.altera.com> | 2014-11-11 12:13:39 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-11-14 16:00:03 -0500 |
commit | f5500ecc90a887d7e65274817733fbe477070559 (patch) | |
tree | 2b328aaff6b33ee91222e02bd8103e840b4e10ab /drivers/usb | |
parent | 8d736d8a9c44547f14711c52875c88d19d8b287b (diff) |
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: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc2/hcd.c | 3 | ||||
-rw-r--r-- | drivers/usb/dwc2/platform.c | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 1a6dea323c8f..a0cd9db6f4cd 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c | |||
@@ -2846,6 +2846,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq, | |||
2846 | int i, num_channels; | 2846 | int i, num_channels; |
2847 | int retval; | 2847 | int retval; |
2848 | 2848 | ||
2849 | if (usb_disabled()) | ||
2850 | return -ENODEV; | ||
2851 | |||
2849 | dev_dbg(hsotg->dev, "DWC OTG HCD INIT\n"); | 2852 | dev_dbg(hsotg->dev, "DWC OTG HCD INIT\n"); |
2850 | 2853 | ||
2851 | /* Detect config values from hardware */ | 2854 | /* Detect config values from hardware */ |
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 3552602ddbf6..57eb8a3e022b 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -157,9 +157,6 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
157 | int retval; | 157 | int retval; |
158 | int irq; | 158 | int irq; |
159 | 159 | ||
160 | if (usb_disabled()) | ||
161 | return -ENODEV; | ||
162 | |||
163 | match = of_match_device(dwc2_of_match_table, &dev->dev); | 160 | match = of_match_device(dwc2_of_match_table, &dev->dev); |
164 | if (match && match->data) { | 161 | if (match && match->data) { |
165 | params = match->data; | 162 | params = match->data; |