diff mbox

[U-Boot,v2,26/32] dm: usb: Unbind old block devices when shutting down USB

Message ID 1456784765-10788-27-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Feb. 29, 2016, 10:25 p.m. UTC
We don't want old block devices hanging around since they can still appear
visible in some way.

Possibly we should unbind all devices which don't cause problems by being
unbound. Most likely we can remove everything except USB controllers, hubs
and emulators. We can consider that later.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 drivers/usb/host/usb-uclass.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Marek Vasut Feb. 29, 2016, 11:05 p.m. UTC | #1
On 02/29/2016 11:25 PM, Simon Glass wrote:
> We don't want old block devices hanging around since they can still appear
> visible in some way.

OK

> Possibly we should unbind all devices which don't cause problems by being
> unbound. Most likely we can remove everything except USB controllers, hubs
> and emulators. We can consider that later.

Can you please expand on this bit of the commit message ? It's not very
clear.

Thanks!

> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
> Changes in v2: None
> 
>  drivers/usb/host/usb-uclass.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
> index 50538e0..69c9a50 100644
> --- a/drivers/usb/host/usb-uclass.c
> +++ b/drivers/usb/host/usb-uclass.c
> @@ -159,7 +159,11 @@ int usb_stop(void)
>  		if (ret && !err)
>  			err = ret;
>  	}
> -
> +#ifdef CONFIG_BLK
> +	ret = blk_unbind_all(IF_TYPE_USB);
> +	if (ret && !err)
> +		err = ret;
> +#endif
>  #ifdef CONFIG_SANDBOX
>  	struct udevice *dev;
>  
>
diff mbox

Patch

diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 50538e0..69c9a50 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -159,7 +159,11 @@  int usb_stop(void)
 		if (ret && !err)
 			err = ret;
 	}
-
+#ifdef CONFIG_BLK
+	ret = blk_unbind_all(IF_TYPE_USB);
+	if (ret && !err)
+		err = ret;
+#endif
 #ifdef CONFIG_SANDBOX
 	struct udevice *dev;