Patchwork [U-Boot,1/3] part: add partition number to disk_partition_t

login
register
mail settings
Submitter Stephen Warren
Date Oct. 8, 2012, 6:15 p.m.
Message ID <1349720127-13169-1-git-send-email-swarren@wwwdotorg.org>
Download mbox | patch
Permalink /patch/190098/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Stephen Warren - Oct. 8, 2012, 6:15 p.m.
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>
---
This series is based on the part_efi/dos partition table printing series
I just sent.

 disk/part.c    |    1 +
 include/part.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/disk/part.c b/disk/part.c
index a0c77dd..2bc7acb 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;
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			*/