This list will be used by the upcoming bfetch command to
determine whether the running barebox has USB hosts registered.

Signed-off-by: Ahmad Fatoum <a.fat...@barebox.org>
---
 drivers/usb/core/usb.c  | 8 ++++----
 include/linux/usb/usb.h | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index d144e9840916..ae87137447c7 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -48,7 +48,7 @@
 static int dev_count;
 static int dev_index;
 
-static LIST_HEAD(host_list);
+LIST_HEAD(usb_host_list);
 LIST_HEAD(usb_device_list);
 
 static void print_usb_device(struct usb_device *dev)
@@ -81,7 +81,7 @@ static int usb_hw_detect(struct device *dev)
 {
        struct usb_host *host;
 
-       list_for_each_entry(host, &host_list, list) {
+       list_for_each_entry(host, &usb_host_list, list) {
                if (dev == host->hw_dev)
                        return usb_host_detect(host);
        }
@@ -91,7 +91,7 @@ static int usb_hw_detect(struct device *dev)
 
 int usb_register_host(struct usb_host *host)
 {
-       list_add_tail(&host->list, &host_list);
+       list_add_tail(&host->list, &usb_host_list);
        host->busnum = host_busnum++;
        slice_init(&host->slice, dev_name(host->hw_dev));
        if (!host->hw_dev->detect)
@@ -653,7 +653,7 @@ int usb_rescan(void)
 
        pr_info("USB: scanning bus for devices...\n");
 
-       list_for_each_entry(host, &host_list, list) {
+       list_for_each_entry(host, &usb_host_list, list) {
                ret = usb_host_detect(host);
                if (ret)
                        continue;
diff --git a/include/linux/usb/usb.h b/include/linux/usb/usb.h
index f2cc69751064..cc994fdff1e6 100644
--- a/include/linux/usb/usb.h
+++ b/include/linux/usb/usb.h
@@ -482,6 +482,7 @@ int otg_device_get_mode(struct device *dev);
 extern struct bus_type otg_bus_type;
 
 extern struct list_head usb_device_list;
+extern struct list_head usb_host_list;
 
 bool usb_hub_is_root_hub(struct usb_device *hdev);
 
-- 
2.39.5


Reply via email to