From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sun, 14 Feb 2016 19:16:55 -0700 Subject: [U-Boot] [PATCH 26/30] dm: usb: Unbind old block devices when shutting down USB In-Reply-To: <1455502619-16093-1-git-send-email-sjg@chromium.org> References: <1455502619-16093-1-git-send-email-sjg@chromium.org> Message-ID: <1455502619-16093-27-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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; -- 2.7.0.rc3.207.g0ac5344