From dce140e7d1bbe1105f2745cc51c229c41d3360be Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Thu, 29 Sep 2022 12:05:02 +0200 Subject: usb: have usb_rescan return count of enumerated devices Some USB mass storage devices can take a comparatively long time after vbus is applied until they can be enumerated. Board code can reissue usb_rescan() to retry enumeration at a later time. It's useful for board code to check whether any new devices have been detected by a usb_rescan() call. To facilitate this, have usb_rescan() return the number of devices found in addition to printing it to the log. Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20220929100502.895553-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- include/usb/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/usb') diff --git a/include/usb/usb.h b/include/usb/usb.h index 39f4750916..04b433ba73 100644 --- a/include/usb/usb.h +++ b/include/usb/usb.h @@ -201,7 +201,7 @@ int usb_clear_halt(struct usb_device *dev, int pipe); int usb_string(struct usb_device *dev, int index, char *buf, size_t size); int usb_set_interface(struct usb_device *dev, int interface, int alternate); -void usb_rescan(void); +int usb_rescan(void); /* big endian -> little endian conversion */ /* some CPUs are already little endian e.g. the ARM920T */ -- cgit v1.2.3