From ab3e59d66417919efd0e213757254a7c295e6c5a Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Thu, 9 Feb 2012 09:36:07 -0800 Subject: usb: properly detect empty mass storage media reader When a USB card reader is empty, it will return "Not Ready - medium not present" as Key Code Qualifier. In that situation, it's useless waiting for the full timeout since the result won't change until the user inserts a card. U-Boot mass storage returns empty mass storage devices with a size of 0, skip them in the VBoot devices enumeration. Signed-off-by: Vincent Palatin BUG=None TEST=On Link, run without a MMC card. Change-Id: Iac37887742e5738e249f595e0413eec16b391fae Reviewed-on: https://gerrit.chromium.org/gerrit/15582 Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin Reviewed-by: Vadim Bendebury --- lib/vbexport/boot_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/vbexport/boot_device.c b/lib/vbexport/boot_device.c index 8b842e1a0a..11daea2176 100644 --- a/lib/vbexport/boot_device.c +++ b/lib/vbexport/boot_device.c @@ -50,7 +50,7 @@ int boot_device_matches(const block_dev_desc_t *dev, { *flags = dev->removable ? VB_DISK_FLAG_REMOVABLE : VB_DISK_FLAG_FIXED; - return (*flags & disk_flags) == disk_flags; + return (*flags & disk_flags) == disk_flags && dev->lba; } /** -- cgit v1.2.3