summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-02-26 16:10:54 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-03-20 10:06:18 +0100
commit54de5cb084c4010dd9cb1a61fb51e68d5339981c (patch)
tree3bb008e4687c7999c0de0129be0eb74a18f66cef
parentf6782becd54847a2149380c751046c319dd07472 (diff)
downloadbarebox-54de5cb084c4010dd9cb1a61fb51e68d5339981c.tar.gz
usb: hub: do not reset devices twice
U-Boot has this since 3ed9eb93c2 ("usb: Don't reset the USB hub a 2nd time"), so do the same for barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/core/hub.c4
-rw-r--r--drivers/usb/core/hub.h7
-rw-r--r--drivers/usb/core/usb.c11
3 files changed, 2 insertions, 20 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 4c9bcc4..4c2e568 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -26,7 +26,6 @@
#include <usb/usb_defs.h>
#include "usb.h"
-#include "hub.h"
#define USB_BUFSIZ 512
@@ -139,7 +138,8 @@ static inline char *portspeed(int portstatus)
return "12 Mb/s";
}
-int hub_port_reset(struct usb_device *hub, int port, struct usb_device *usb)
+static int hub_port_reset(struct usb_device *hub, int port,
+ struct usb_device *usb)
{
int tries;
struct usb_port_status portsts;
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
deleted file mode 100644
index 74921b6..0000000
--- a/drivers/usb/core/hub.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __CORE_HUB_H
-#define __CORE_HUB_H
-
-int hub_port_reset(struct usb_device *hub, int port,
- struct usb_device *usb);
-
-#endif /* __CORE_HUB_H */
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 1c3dcb7..8a144c9 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -57,7 +57,6 @@
#include <usb/ch9.h>
#include "usb.h"
-#include "hub.h"
#define USB_BUFSIZ 512
@@ -351,16 +350,6 @@ int usb_new_device(struct usb_device *dev)
dev->descriptor->bMaxPacketSize0 = desc->bMaxPacketSize0;
- /* find the port number we're at */
- if (parent) {
- /* reset the port for the second time */
- err = hub_port_reset(dev->parent, dev->portnr - 1, dev);
- if (err < 0) {
- printf("\n Couldn't reset port %i\n", dev->portnr);
- goto err_out;
- }
- }
-
dev->epmaxpacketin[0] = dev->descriptor->bMaxPacketSize0;
dev->epmaxpacketout[0] = dev->descriptor->bMaxPacketSize0;
switch (dev->descriptor->bMaxPacketSize0) {