mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 03/24] usb: hub: let usb_scan_port() return void
Date: Wed, 25 Mar 2020 13:30:50 +0100	[thread overview]
Message-ID: <20200325123111.9612-4-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20200325123111.9612-1-s.hauer@pengutronix.de>

usb_scan_port() never returns anything else but 0, so let it return
void.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/core/hub.c | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 4c2e568066..cc0c4c04d5 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -270,7 +270,7 @@ static void usb_hub_port_connect_change(struct usb_device *dev, int port)
 	device_detect(&usb->dev);
 }
 
-static int usb_scan_port(struct usb_device_scan *usb_scan)
+static void usb_scan_port(struct usb_device_scan *usb_scan)
 {
 	struct usb_port_status portsts;
 	unsigned short portstatus, portchange;
@@ -287,7 +287,7 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 	 * This is needed for voltages to stabilize.
 	 */
 	if (get_time_ns() < hub->query_delay)
-		return 0;
+		return;
 
 	if (usb_get_port_status(dev, port + 1, &portsts) < 0) {
 		dev_dbg(&dev->dev, "port%d: get_port_status failed\n", port + 1);
@@ -296,7 +296,7 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 			/* Remove this device from scanning list */
 			goto remove;
 		}
-		return 0;
+		return;
 	}
 
 	portstatus = le16_to_cpu(portsts.wPortStatus);
@@ -310,12 +310,12 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 			/* Remove this device from scanning list */
 			goto remove;
 		}
-		return 0;
+		return;
 	}
 
 	/* Test if the connection came up, and if not exit */
 	if(!(portstatus & USB_PORT_STAT_CONNECTION))
-		return 0;
+		return;
 
 	/* A new USB device is ready at this point */
 	dev_dbg(&dev->dev, "port%d: USB dev found\n", port + 1);
@@ -361,7 +361,7 @@ static int usb_scan_port(struct usb_device_scan *usb_scan)
 		 */
 		if (hub->overcurrent_count[port] <=
 				PORT_OVERCURRENT_MAX_SCAN_COUNT)
-			return 0;
+			return;
 
 		/* Otherwise the device will get removed */
 		dev_dbg(&dev->dev,"port%d: over-current occurred %d times\n",
@@ -381,8 +381,6 @@ remove:
 	 */
 	list_del(&usb_scan->list);
 	free(usb_scan);
-
-	return 0;
 }
 
 static int usb_device_list_scan(void)
@@ -390,7 +388,6 @@ static int usb_device_list_scan(void)
 	struct usb_device_scan *usb_scan;
 	struct usb_device_scan *tmp;
 	static int running;
-	int ret = 0;
 
 	/* Only run this loop once for each controller */
 	if (running)
@@ -403,12 +400,8 @@ static int usb_device_list_scan(void)
 		if (list_empty(&usb_scan_list))
 			goto out;
 
-		list_for_each_entry_safe(usb_scan, tmp, &usb_scan_list, list) {
-			/* Scan this port */
-			ret = usb_scan_port(usb_scan);
-			if (ret)
-				goto out;
-		}
+		list_for_each_entry_safe(usb_scan, tmp, &usb_scan_list, list)
+			usb_scan_port(usb_scan);
 
 		/* Avoid hammering the HUB with port scans */
 		mdelay(25);
@@ -422,7 +415,7 @@ out:
 	 */
 	running = 0;
 
-	return ret;
+	return 0;
 }
 
 static int usb_hub_configure(struct usb_device *dev)
-- 
2.26.0.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-03-25 12:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 12:30 [PATCH 00/24] USB3 support Sascha Hauer
2020-03-25 12:30 ` [PATCH 01/24] usb: hub: Make debugging output more consistent Sascha Hauer
2020-03-25 12:30 ` [PATCH 02/24] usb: hub: do not reset devices twice Sascha Hauer
2020-03-25 12:30 ` Sascha Hauer [this message]
2020-03-25 12:30 ` [PATCH 04/24] usb: Remove hack from the early days Sascha Hauer
2020-03-25 12:30 ` [PATCH 05/24] usb: Pass portstatus/portchange to usb_hub_port_connect_change() Sascha Hauer
2020-03-25 12:30 ` [PATCH 06/24] usb: hub: Do not power-cycle usb devices on init Sascha Hauer
2020-03-25 12:30 ` [PATCH 07/24] usb: Make driver_info const Sascha Hauer
2020-03-25 12:30 ` [PATCH 08/24] usb: Set new USB device name earlier Sascha Hauer
2020-03-25 12:30 ` [PATCH 09/24] usb: Use dev_* Sascha Hauer
2020-03-25 12:30 ` [PATCH 10/24] usb: hub: Parse and save TT details from device descriptor Sascha Hauer
2020-03-25 12:30 ` [PATCH 11/24] usb: host: make init hook optional Sascha Hauer
2020-03-25 12:30 ` [PATCH 12/24] usb: support set hub depth request for USB 3.0 hubs Sascha Hauer
2020-03-25 12:31 ` [PATCH 13/24] usb: Assign dev_index once Sascha Hauer
2020-03-25 12:31 ` [PATCH 14/24] usb: remove unnecessary variable Sascha Hauer
2020-03-25 12:31 ` [PATCH 15/24] usb: net: Allocate rx buffer dynamically Sascha Hauer
2020-03-25 14:18   ` Jules Maselbas
2020-03-26  6:22     ` Sascha Hauer
2020-03-25 12:31 ` [PATCH 16/24] usb: net: Allocate tx " Sascha Hauer
2020-03-25 12:31 ` [PATCH 17/24] net: usb: add hook for link changes Sascha Hauer
2020-03-25 12:31 ` [PATCH 18/24] usb: net: Add support for the Asix AX88179 Sascha Hauer
2020-03-25 12:31 ` [PATCH 19/24] usb: factor out a usb_setup_descriptor() function Sascha Hauer
2020-03-25 12:31 ` [PATCH 20/24] usb: hub: Translate USB 3.0 hub port status into old version Sascha Hauer
2020-03-25 12:31 ` [PATCH 21/24] usb: Add super speed support Sascha Hauer
2020-03-25 12:31 ` [PATCH 22/24] usb: hub: When no connection came up remove from scanning list Sascha Hauer
2020-03-25 12:31 ` [PATCH 23/24] usb: host: remove xhci driver Sascha Hauer
2020-03-25 12:31 ` [PATCH 24/24] usb: Add U-Boot " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200325123111.9612-4-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox