summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-02-27 09:46:55 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-03-20 10:07:16 +0100
commit4f6199ac5322427777c54752bb9a073ebee9fd49 (patch)
tree8b319f9d5541e96f19e09c2f53482f478c9e2c5b /drivers/usb/core
parent2054040d0504cd5e3e61ea36110be72f5cab0e76 (diff)
downloadbarebox-4f6199ac5322427777c54752bb9a073ebee9fd49.tar.gz
barebox-4f6199ac5322427777c54752bb9a073ebee9fd49.tar.xz
usb: Pass portstatus/portchange to usb_hub_port_connect_change()
portstatus/portchange have just been read in usb_scan_port(), there shouldn't be any need to read them again in usb_hub_port_connect_change(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hub.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 0569d0f94b..59354895df 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -203,22 +203,10 @@ static int hub_port_reset(struct usb_device *hub, int port,
}
-static void usb_hub_port_connect_change(struct usb_device *dev, int port)
+static void usb_hub_port_connect_change(struct usb_device *dev, int port,
+ uint16_t portstatus, uint16_t portchange)
{
struct usb_device *usb;
- struct usb_port_status portsts;
- unsigned short portstatus, portchange;
-
- /* Check status */
- if (usb_get_port_status(dev, port + 1, &portsts) < 0) {
- dev_dbg(&dev->dev, "port%d: get_port_status failed\n", port + 1);
- return;
- }
-
- portstatus = le16_to_cpu(portsts.wPortStatus);
- portchange = le16_to_cpu(portsts.wPortChange);
- dev_dbg(&dev->dev, "port%d: status 0x%04x, change 0x%04x, %s\n",
- port + 1, portstatus, portchange, portspeed(portstatus));
/* Clear the connection change status */
usb_clear_port_feature(dev, port + 1, USB_PORT_FEAT_C_CONNECTION);
@@ -320,7 +308,7 @@ static void usb_scan_port(struct usb_device_scan *usb_scan)
/* A new USB device is ready at this point */
dev_dbg(&dev->dev, "port%d: USB dev found\n", port + 1);
- usb_hub_port_connect_change(dev, port);
+ usb_hub_port_connect_change(dev, port, portstatus, portchange);
if (portchange & USB_PORT_STAT_C_ENABLE) {
dev_dbg(&dev->dev, "port%d: enable change, status 0x%04x\n",