diff mbox

[U-Boot,3/4] part: efi: make gpt_fill_pte take the device descriptor

Message ID 20170823140133.1506-3-maxime.ripard@free-electrons.com
State Accepted
Commit 47d7ee47baf2c92dad390251e6c1306afa7eea29
Delegated to: Tom Rini
Headers show

Commit Message

Maxime Ripard Aug. 23, 2017, 2:01 p.m. UTC
The gpt_fill_pte will need to access the device block size. Let's pass the
device descriptor as an argument.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 disk/part_efi.c | 7 ++++---
 include/part.h  | 6 ++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

Comments

Tom Rini Aug. 25, 2017, 1:05 a.m. UTC | #1
On Wed, Aug 23, 2017 at 04:01:32PM +0200, Maxime Ripard wrote:

> The gpt_fill_pte will need to access the device block size. Let's pass the
> device descriptor as an argument.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Sept. 4, 2017, 12:41 a.m. UTC | #2
On Wed, Aug 23, 2017 at 04:01:32PM +0200, Maxime Ripard wrote:

> The gpt_fill_pte will need to access the device block size. Let's pass the
> device descriptor as an argument.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/disk/part_efi.c b/disk/part_efi.c
index fa95ce12329a..807d01de39d0 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -428,8 +428,9 @@  int write_gpt_table(struct blk_desc *dev_desc,
 	return -1;
 }
 
-int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
-		disk_partition_t *partitions, int parts)
+int gpt_fill_pte(struct blk_desc *dev_desc,
+		 gpt_header *gpt_h, gpt_entry *gpt_e,
+		 disk_partition_t *partitions, int parts)
 {
 	lbaint_t offset = (lbaint_t)le64_to_cpu(gpt_h->first_usable_lba);
 	lbaint_t last_usable_lba = (lbaint_t)
@@ -633,7 +634,7 @@  int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
 		goto err;
 
 	/* Generate partition entries */
-	ret = gpt_fill_pte(gpt_h, gpt_e, partitions, parts_count);
+	ret = gpt_fill_pte(dev_desc, gpt_h, gpt_e, partitions, parts_count);
 	if (ret)
 		goto err;
 
diff --git a/include/part.h b/include/part.h
index 0cd803a9334f..0d5c99836b25 100644
--- a/include/part.h
+++ b/include/part.h
@@ -289,6 +289,7 @@  int write_gpt_table(struct blk_desc *dev_desc,
 /**
  * gpt_fill_pte(): Fill the GPT partition table entry
  *
+ * @param dev_desc - block device descriptor
  * @param gpt_h - GPT header representation
  * @param gpt_e - GPT partition table entries
  * @param partitions - list of partitions
@@ -296,8 +297,9 @@  int write_gpt_table(struct blk_desc *dev_desc,
  *
  * @return zero on success
  */
-int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
-		disk_partition_t *partitions, int parts);
+int gpt_fill_pte(struct blk_desc *dev_desc,
+		 gpt_header *gpt_h, gpt_entry *gpt_e,
+		 disk_partition_t *partitions, int parts);
 
 /**
  * gpt_fill_header(): Fill the GPT header