[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1414538749-14735-9-git-send-email-dinguyen@opensource.altera.com>
Date: Tue, 28 Oct 2014 18:25:49 -0500
From: <dinguyen@...nsource.altera.com>
To: <paulz@...opsys.com>, <balbi@...com>
CC: <dinh.linux@...il.com>, <swarren@...dotorg.org>,
<b.zolnierkie@...sung.com>, <matthijs@...in.nl>,
<r.baldyga@...sung.com>, <jg1.han@...sung.com>,
<sachin.kamat@...aro.org>, <ben-linux@...ff.org>,
<dianders@...omium.org>, <kever.yang@...k-chips.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Dinh Nguyen <dinguyen@...nsource.altera.com>
Subject: [PATCHv6 8/8] usb: dwc2: move usb_disabled() call to host driver only
From: Dinh Nguyen <dinguyen@...nsource.altera.com>
Now that 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.
Signed-off-by: Dinh Nguyen <dinguyen@...nsource.altera.com>
---
drivers/usb/dwc2/hcd.c | 3 +++
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 fa49c72..b741997 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -2780,6 +2780,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 */
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 77c8417..123cf54 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)
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;
--
2.0.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists