]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
usb: Drop device-model specific copy of usb_legacy_port_reset
authorHans de Goede <hdegoede@redhat.com>
Wed, 17 Jun 2015 19:33:45 +0000 (21:33 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 21 Jul 2015 23:39:34 +0000 (17:39 -0600)
The device-model usb_legacy_port_reset function calls the device-model
usb_port_reset function which is a 1 on 1 copy of the non dm
usb_legacy_port_reset and this is the only use of usb_port_reset in all
of u-boot.

Drop both, and alway use the usb_legacy_port_reset() version in
common/usb.c .

Also while at it make it static as it is only used in common/usb.c .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
common/usb.c
drivers/usb/host/usb-uclass.c
include/usb.h

index 7ff8ac5df364f6cb78ec3e522948402c969f3104..4ddf98f8a770e9b4d8b3f02d50e004e1677a01d9 100644 (file)
@@ -911,8 +911,7 @@ __weak int usb_alloc_device(struct usb_device *udev)
 }
 #endif /* !CONFIG_DM_USB */
 
-#ifndef CONFIG_DM_USB
-int usb_legacy_port_reset(struct usb_device *hub, int portnr)
+static int usb_legacy_port_reset(struct usb_device *hub, int portnr)
 {
        if (hub) {
                unsigned short portstatus;
@@ -930,7 +929,6 @@ int usb_legacy_port_reset(struct usb_device *hub, int portnr)
 
        return 0;
 }
-#endif
 
 static int get_descriptor_len(struct usb_device *dev, int len, int expect_len)
 {
index 6e86f4a24a48ff26e19013ed7746d60212a66705..10d47127b851b81d0a7f8a01063ea3c0cefec9bc 100644 (file)
@@ -310,35 +310,6 @@ int usb_post_bind(struct udevice *dev)
        return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
 }
 
-int usb_port_reset(struct usb_device *parent, int portnr)
-{
-       unsigned short portstatus;
-       int ret;
-
-       debug("%s: start\n", __func__);
-
-       if (parent) {
-               /* reset the port for the second time */
-               assert(portnr > 0);
-               debug("%s: reset %d\n", __func__, portnr - 1);
-               ret = legacy_hub_port_reset(parent, portnr - 1, &portstatus);
-               if (ret < 0) {
-                       printf("\n     Couldn't reset port %i\n", portnr);
-                       return ret;
-               }
-       } else {
-               debug("%s: reset root\n", __func__);
-               usb_reset_root_port();
-       }
-
-       return 0;
-}
-
-int usb_legacy_port_reset(struct usb_device *parent, int portnr)
-{
-       return usb_port_reset(parent, portnr);
-}
-
 int usb_setup_ehci_gadget(struct ehci_ctrl **ctlrp)
 {
        struct usb_platdata *plat;
index dca512d394b8445c13d616699d099ca3c23107e7..6b5d5361a9941c6d59db3bc6115a84a5728e2315 100644 (file)
@@ -729,14 +729,6 @@ int usb_reset_root_port(void);
  */
 struct usb_device *usb_get_dev_index(struct udevice *bus, int index);
 
-/**
- * usb_legacy_port_reset() - Legacy function to reset a hub port
- *
- * @hub:       Hub device
- * @portnr:    Port number (1=first)
- */
-int usb_legacy_port_reset(struct usb_device *hub, int portnr);
-
 /**
  * usb_setup_device() - set up a device ready for use
  *