aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorStephen Warren2012-10-05 08:17:39 -0500
committerTom Rini2012-10-08 13:15:04 -0500
commitbd1a7e3034006ec121d35d745fd455212a56f7fd (patch)
tree37a9db40647839234105a220d0f075acb30f9b9a /fs
parent03eecab9a1ba5f0226987a6ea58eb75a41d23408 (diff)
downloadu-boot-bd1a7e3034006ec121d35d745fd455212a56f7fd.tar.gz
u-boot-bd1a7e3034006ec121d35d745fd455212a56f7fd.tar.xz
u-boot-bd1a7e3034006ec121d35d745fd455212a56f7fd.zip
FAT: check for partition 0 not 1 for whole-disk fs
The recent switch to use get_device_and_partition() from do_fat_ls() broke the ability to access a FAT filesystem directly on a whole device; FAT only works within a partition on a device. This change makes e.g. "fatls mmc 0:0" work; explicitly requesting partition ID 0 is something that get_device_and_partition() fully supports. However, fat_register_device() expects partition ID 1 to be used in the full-disk case; partition ID 1 was previously implicitly specified when the user didn't actually specify a partition ID. Update fat_register_device() to expect the correct ID. This change does imply that if a user explicitly executes "fatls mmc 0:1" then this will fail, and may be a change in behaviour. Note that this still prevents "fatls mmc 0:auto" from working. The next patch will fix that. Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 41ae15eeb9..80156c815f 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -85,7 +85,7 @@ int fat_register_device(block_dev_desc_t * dev_desc, int part_no)
85 85
86 /* Otherwise it might be a superfloppy (whole-disk FAT filesystem) */ 86 /* Otherwise it might be a superfloppy (whole-disk FAT filesystem) */
87 if (!cur_dev) { 87 if (!cur_dev) {
88 if (part_no != 1) { 88 if (part_no != 0) {
89 printf("** Partition %d not valid on device %d **\n", 89 printf("** Partition %d not valid on device %d **\n",
90 part_no, dev_desc->dev); 90 part_no, dev_desc->dev);
91 return -1; 91 return -1;