From patchwork Fri Oct 5 23:17:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 189625 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id BCF9B2C0326 for ; Sat, 6 Oct 2012 09:17:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6554A28088; Sat, 6 Oct 2012 01:17:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QGT0rgJuj9vJ; Sat, 6 Oct 2012 01:17:55 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 06CF028080; Sat, 6 Oct 2012 01:17:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3D94228081 for ; Sat, 6 Oct 2012 01:17:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T3bhOfOM+GaP for ; Sat, 6 Oct 2012 01:17:50 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 19CB82807E for ; Sat, 6 Oct 2012 01:17:48 +0200 (CEST) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 1B7C1625B; Fri, 5 Oct 2012 17:19:07 -0600 (MDT) Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 11FABE40FA; Fri, 5 Oct 2012 17:17:44 -0600 (MDT) From: Stephen Warren To: Tom Rini Date: Fri, 5 Oct 2012 17:17:39 -0600 Message-Id: <1349479060-3211-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.0.4 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: u-boot@lists.denx.de, Stephen Warren , Rob Herring Subject: [U-Boot] [PATCH 1/2] FAT: check for partition 0 not 1 for whole-disk fs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Stephen Warren 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 --- Tom, this series is really a bug-fix and should go in before the 9-long series I posted earlier today. I'll need to rebase that other series on top of this and repost, once any comments are addressed. --- fs/fat/fat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 41ae15e..80156c8 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) /* 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;