From 4f6199ac5322427777c54752bb9a073ebee9fd49 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 27 Feb 2020 09:46:55 +0100 Subject: 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 --- drivers/usb/core/hub.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'drivers/usb/core') 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", -- cgit v1.2.3