]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/cmd_usb.c
karo: fdt: fix panel-dpi support
[karo-tx-uboot.git] / common / cmd_usb.c
index ca06826901feb9d1a5d2e044fcb55115bf66044b..6874af7547148276f8b9564aa1e4b4e01ba8c7e1 100644 (file)
@@ -22,8 +22,8 @@
 #ifdef CONFIG_USB_STORAGE
 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 */
+#if defined(CONFIG_USB_HOST_ETHER) && !defined(CONFIG_DM_ETH)
+static int __maybe_unused usb_ether_curr_dev = -1; /* current ethernet device */
 #endif
 
 /* some display routines (info command) */
@@ -532,8 +532,14 @@ static void do_usb_start(void)
 #endif
 #endif
 #ifdef CONFIG_USB_HOST_ETHER
+# ifdef CONFIG_DM_ETH
+#  ifndef CONFIG_DM_USB
+#   error "You must use CONFIG_DM_USB if you want to use CONFIG_USB_HOST_ETHER with CONFIG_DM_ETH"
+#  endif
+# else
        /* 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();
@@ -630,12 +636,11 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                     bus;
                     uclass_next_device(&bus)) {
                        struct usb_device *udev;
-                       struct udevice *hub;
+                       struct udevice *dev;
 
-                       device_find_first_child(bus, &hub);
-                       if (device_get_uclass_id(hub) == UCLASS_USB_HUB &&
-                           device_active(hub)) {
-                               udev = dev_get_parentdata(hub);
+                       device_find_first_child(bus, &dev);
+                       if (dev && device_active(dev)) {
+                               udev = dev_get_parentdata(dev);
                                usb_show_tree(udev);
                        }
                }