diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-01-25 14:53:14 +0300 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-04-10 13:00:24 +0300 |
commit | 02079eb38b1dd87bf5ae00216f513a2fb831e4d5 (patch) | |
tree | a919963b82cfea44ff06506d1528fbb00bbc129e | |
parent | f4dc1bc9f0ad0ee1d23aa185a4e8d9e904e6d88e (diff) | |
download | u-boot-02079eb38b1dd87bf5ae00216f513a2fb831e4d5.tar.xz |
fs: fat: fix file_fat_detectfs()
Up to now file_fat_detectfs() did not detect some interface types like
EFI, HOST, VIRTIO.
Avoid duplicate code by calling blk_get_if_type_name().
The interface type now will be shown in lower case to match all other use
cases.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | fs/fat/fat.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index ccba268f61..c561d82b35 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -1147,42 +1147,12 @@ int file_fat_detectfs(void) return 1; } -#if defined(CONFIG_IDE) || \ - defined(CONFIG_SATA) || \ - defined(CONFIG_SCSI) || \ - defined(CONFIG_CMD_USB) || \ - defined(CONFIG_MMC) - printf("Interface: "); - switch (cur_dev->if_type) { - case IF_TYPE_IDE: - printf("IDE"); - break; - case IF_TYPE_SATA: - printf("SATA"); - break; - case IF_TYPE_SCSI: - printf("SCSI"); - break; - case IF_TYPE_ATAPI: - printf("ATAPI"); - break; - case IF_TYPE_USB: - printf("USB"); - break; - case IF_TYPE_DOC: - printf("DOC"); - break; - case IF_TYPE_MMC: - printf("MMC"); - break; - default: - printf("Unknown"); + if (IS_ENABLED(CONFIG_HAVE_BLOCK_DEVICE)) { + printf("Interface: %s\n", blk_get_if_type_name(cur_dev->if_type)); + printf(" Device %d: ", cur_dev->devnum); + dev_print(cur_dev); } - printf("\n Device %d: ", cur_dev->devnum); - dev_print(cur_dev); -#endif - if (read_bootsectandvi(&bs, &volinfo, &fatsize)) { printf("\nNo valid FAT fs found\n"); return 1; |