]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
FAT: check for partition 0 not 1 for whole-disk fs
authorStephen Warren <swarren@nvidia.com>
Fri, 5 Oct 2012 13:17:39 +0000 (13:17 +0000)
committerTom Rini <trini@ti.com>
Mon, 8 Oct 2012 18:15:04 +0000 (11:15 -0700)
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>
fs/fat/fat.c

index 41ae15eeb976e74e7fab805be15364d52c390563..80156c815f8e392bc01809cbcc31b87ed3757e9a 100644 (file)
@@ -85,7 +85,7 @@ int fat_register_device(block_dev_desc_t * dev_desc, int part_no)
 
        /* Otherwise it might be a superfloppy (whole-disk FAT filesystem) */
        if (!cur_dev) {
-               if (part_no != 1) {
+               if (part_no != 0) {
                        printf("** Partition %d not valid on device %d **\n",
                                        part_no, dev_desc->dev);
                        return -1;