mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
dm: usb: Unbind old block devices when shutting down USB
When 'usb start' is used, block devices are created for any USB flash sticks and disks, etc. When 'usb stop' is used, these block devices are currently not removed. We don't want old block devices hanging around since they can still be visible to U-Boot. Therefore, when USB is shut down, remove and unbind all the block devices created by the USB subsystem. 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> Tested-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
c81d0d215e
commit
9b9775687f
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue