summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-07-06 16:47:48 -0600
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:39 -0600
commit69559093f6173dcfcb041df0995063bdbd07d49b (patch)
treec5bb51d0b1b43914f1b2555e86c049c04e88c386 /common
parentb483915ffda96dc5979fcc034d16420221b2ca25 (diff)
downloadtalos-obmc-uboot-69559093f6173dcfcb041df0995063bdbd07d49b.tar.gz
talos-obmc-uboot-69559093f6173dcfcb041df0995063bdbd07d49b.zip
dm: usb: Avoid using USB ethernet with CONFIG_DM_USB and no DM_ETH
If driver model is used for Ethernet then USB Ethernet does not build. This can be made to work with driver model is used for USB also. Add #ifdef logic to make this clear when building. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_usb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 2ed4cb474f..6198d063d1 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -23,7 +23,7 @@
static int usb_stor_curr_dev = -1; /* current device */
#endif
#ifdef CONFIG_USB_HOST_ETHER
-static int usb_ether_curr_dev = -1; /* current ethernet device */
+static int __maybe_unused usb_ether_curr_dev = -1; /* current ethernet device */
#endif
/* some display routines (info command) */
@@ -530,11 +530,14 @@ static void do_usb_start(void)
/* try to recognize storage devices immediately */
usb_stor_curr_dev = usb_stor_scan(1);
#endif
-#endif
#ifdef CONFIG_USB_HOST_ETHER
+# ifdef CONFIG_DM_ETH
+# error "You must use CONFIG_DM_USB if you want to use CONFIG_USB_HOST_ETHER with CONFIG_DM_ETH"
+# endif
/* try to recognize ethernet devices immediately */
usb_ether_curr_dev = usb_host_eth_scan(1);
#endif
+#endif
#ifdef CONFIG_USB_KEYBOARD
drv_usb_kbd_init();
#endif
OpenPOWER on IntegriCloud