[U-Boot] [PATCH] usb: host: Move CONFIG_USB_MAX_CONTROLLER_COUNT to non-dm

Jagan Teki jteki at openedev.com
Sat Oct 15 15:02:46 CEST 2016


CONFIG_USB_MAX_CONTROLLER_COUNT not used in DM_USB, hence moved
to non-dm from global area.

Cc: Simon Glass <sjg at chromium.org>
Cc: Marek Vasut <marex at denx.de>
Cc: Masahiro Yamada <yamada.masahiro at socionext.com>
Signed-off-by: Jagan Teki <jteki at openedev.com>
---
 drivers/usb/host/ehci-hcd.c | 8 ++++----
 drivers/usb/host/xhci.c     | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 13aa70d..d8dc827 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -21,10 +21,6 @@
 
 #include "ehci.h"
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
 /*
  * EHCI spec page 20 says that the HC may take up to 16 uFrames (= 4ms) to halt.
  * Let's time out after 8 to have a little safety margin on top of that.
@@ -32,6 +28,10 @@
 #define HCHALT_TIMEOUT (8 * 1000)
 
 #ifndef CONFIG_DM_USB
+# ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
+#  define CONFIG_USB_MAX_CONTROLLER_COUNT 1
+# endif
+
 static struct ehci_ctrl ehcic[CONFIG_USB_MAX_CONTROLLER_COUNT];
 #endif
 
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 3201177..bb276da 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -31,10 +31,6 @@
 #include <linux/errno.h>
 #include "xhci.h"
 
-#ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
-
 static struct descriptor {
 	struct usb_hub_descriptor hub;
 	struct usb_device_descriptor device;
@@ -110,6 +106,10 @@ static struct descriptor {
 };
 
 #ifndef CONFIG_DM_USB
+# ifndef CONFIG_USB_MAX_CONTROLLER_COUNT
+#  define CONFIG_USB_MAX_CONTROLLER_COUNT 1
+# endif
+
 static struct xhci_ctrl xhcic[CONFIG_USB_MAX_CONTROLLER_COUNT];
 #endif
 
-- 
2.7.4



More information about the U-Boot mailing list