public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V3 1/4] part: add partition number to disk_partition_t
@ 2012-10-10 18:13 Stephen Warren
  2012-10-10 18:14 ` [U-Boot] [PATCH V3 2/4] FAT: make use of disk_partition_t.part Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Stephen Warren @ 2012-10-10 18:13 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

The FAT filesystem code knows which partition ID it is operating on.
Currently, this is passed to fat_register_device() as a parameter.
In order to convert FAT to the more standardized fat_set_blk_dev(), the
information needs to come from somewhere else, and the partition
definition structure is the logical place.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v3: Set info->part in get_device_and_partition() when returning "whole
    disk" partition.
v2: No change.
---
 disk/part.c    |    2 ++
 include/part.h |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index 8ba3cde..6d8135d 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -391,6 +391,7 @@ int get_partition_info(block_dev_desc_t *dev_desc, int part
 	defined(CONFIG_MMC) || \
 	defined(CONFIG_SYSTEMACE)
 
+	info->part = part;
 #ifdef CONFIG_PARTITION_UUIDS
 	/* The common case is no UUID support */
 	info->uuid[0] = 0;
@@ -557,6 +558,7 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
 			goto cleanup;
 		}
 
+		info->part = 0;
 		info->start = 0;
 		info->size = (*dev_desc)->lba;
 		info->blksz = (*dev_desc)->blksz;
diff --git a/include/part.h b/include/part.h
index 27ea283..ebdebd8 100644
--- a/include/part.h
+++ b/include/part.h
@@ -88,6 +88,7 @@ typedef struct block_dev_desc {
 #define DEV_TYPE_OPDISK		0x07	/* optical disk */
 
 typedef struct disk_partition {
+	int	part;		/* Partition number			*/
 	ulong	start;		/* # of first block in partition	*/
 	ulong	size;		/* number of blocks in partition	*/
 	ulong	blksz;		/* block size in bytes			*/
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-10-17 16:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10 18:13 [U-Boot] [PATCH V3 1/4] part: add partition number to disk_partition_t Stephen Warren
2012-10-10 18:14 ` [U-Boot] [PATCH V3 2/4] FAT: make use of disk_partition_t.part Stephen Warren
2012-10-13 19:38   ` Pavel Herrmann
2012-10-15 16:40     ` Stephen Warren
2012-10-15 18:07       ` Pavel Herrmann
2012-10-17 16:23         ` Tom Rini
2012-10-10 18:14 ` [U-Boot] [PATCH V3 3/4] FAT: initialize all fields in cur_part_info, simplify init Stephen Warren
2012-10-10 18:14 ` [U-Boot] [PATCH V3 4/4] FAT: implement fat_set_blk_dev(), convert cmd_fat.c Stephen Warren
2012-10-10 18:44   ` Benoît Thébaudeau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox