U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Simon Glass <sjg@chromium.org>
Subject: [PATCH 02/24] part: amiga: Use desc instead of dev_desc
Date: Sun, 13 Aug 2023 08:26:30 -0600	[thread overview]
Message-ID: <20230813142708.361456-3-sjg@chromium.org> (raw)
In-Reply-To: <20230813142708.361456-1-sjg@chromium.org>

The dev_ prefix is a hangover from the pre-driver model days. The device
is now a different thing, with driver model. Update the amiga code to
just use 'desc'.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 disk/part_amiga.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index 45d3a7048669..65e30fea558d 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -125,7 +125,7 @@ static void print_part_info(struct partition_block *p)
  * the ID AMIGA_ID_RDISK ('RDSK') and needs to have a valid
  * sum-to-zero checksum
  */
-struct rigid_disk_block *get_rdisk(struct blk_desc *dev_desc)
+struct rigid_disk_block *get_rdisk(struct blk_desc *desc)
 {
     int i;
     int limit;
@@ -139,7 +139,7 @@ struct rigid_disk_block *get_rdisk(struct blk_desc *dev_desc)
 
     for (i=0; i<limit; i++)
     {
-	ulong res = blk_dread(dev_desc, i, 1, (ulong *)block_buffer);
+	ulong res = blk_dread(desc, i, 1, (ulong *)block_buffer);
 	if (res == 1)
 	{
 	    struct rigid_disk_block *trdb = (struct rigid_disk_block *)block_buffer;
@@ -165,7 +165,7 @@ struct rigid_disk_block *get_rdisk(struct blk_desc *dev_desc)
  * Ridgid disk block
  */
 
-struct bootcode_block *get_bootcode(struct blk_desc *dev_desc)
+struct bootcode_block *get_bootcode(struct blk_desc *desc)
 {
     int i;
     int limit;
@@ -181,7 +181,7 @@ struct bootcode_block *get_bootcode(struct blk_desc *dev_desc)
 
     for (i = 0; i < limit; i++)
     {
-	ulong res = blk_dread(dev_desc, i, 1, (ulong *)block_buffer);
+	ulong res = blk_dread(desc, i, 1, (ulong *)block_buffer);
 	if (res == 1)
 	{
 	    struct bootcode_block *boot = (struct bootcode_block *)block_buffer;
@@ -206,17 +206,17 @@ struct bootcode_block *get_bootcode(struct blk_desc *dev_desc)
  * Test if the given partition has an Amiga partition table/Rigid
  * Disk block
  */
-static int part_test_amiga(struct blk_desc *dev_desc)
+static int part_test_amiga(struct blk_desc *desc)
 {
     struct rigid_disk_block *rdb;
     struct bootcode_block *bootcode;
 
     PRINTF("part_test_amiga: Testing for an Amiga RDB partition\n");
 
-    rdb = get_rdisk(dev_desc);
+	rdb = get_rdisk(desc);
     if (rdb)
     {
-	bootcode = get_bootcode(dev_desc);
+	bootcode = get_bootcode(desc);
 	if (bootcode)
 	    PRINTF("part_test_amiga: bootable Amiga disk\n");
 	else
@@ -235,7 +235,7 @@ static int part_test_amiga(struct blk_desc *dev_desc)
 /*
  * Find partition number partnum on the given drive.
  */
-static struct partition_block *find_partition(struct blk_desc *dev_desc,
+static struct partition_block *find_partition(struct blk_desc *desc,
 					      int partnum)
 {
     struct rigid_disk_block *rdb;
@@ -243,7 +243,7 @@ static struct partition_block *find_partition(struct blk_desc *dev_desc,
     u32 block;
 
     PRINTF("Trying to find partition block %d\n", partnum);
-    rdb = get_rdisk(dev_desc);
+	rdb = get_rdisk(desc);
     if (!rdb)
     {
 	PRINTF("find_partition: no rdb found\n");
@@ -257,7 +257,7 @@ static struct partition_block *find_partition(struct blk_desc *dev_desc,
 
     while (block != 0xFFFFFFFF)
     {
-	ulong res = blk_dread(dev_desc, block, 1, (ulong *)block_buffer);
+	ulong res = blk_dread(desc, block, 1, (ulong *)block_buffer);
 	if (res == 1)
 	{
 	    p = (struct partition_block *)block_buffer;
@@ -289,10 +289,10 @@ static struct partition_block *find_partition(struct blk_desc *dev_desc,
 /*
  * Get info about a partition
  */
-static int part_get_info_amiga(struct blk_desc *dev_desc, int part,
-				    struct disk_partition *info)
+static int part_get_info_amiga(struct blk_desc *desc, int part,
+			       struct disk_partition *info)
 {
-    struct partition_block *p = find_partition(dev_desc, part-1);
+	struct partition_block *p = find_partition(desc, part - 1);
     struct amiga_part_geometry *g;
     u32 disk_type;
 
@@ -317,7 +317,7 @@ static int part_get_info_amiga(struct blk_desc *dev_desc, int part,
     return 0;
 }
 
-static void part_print_amiga(struct blk_desc *dev_desc)
+static void part_print_amiga(struct blk_desc *desc)
 {
     struct rigid_disk_block *rdb;
     struct bootcode_block *boot;
@@ -325,7 +325,7 @@ static void part_print_amiga(struct blk_desc *dev_desc)
     u32 block;
     int i = 1;
 
-    rdb = get_rdisk(dev_desc);
+	rdb = get_rdisk(desc);
     if (!rdb)
     {
 	PRINTF("part_print_amiga: no rdb found\n");
@@ -353,7 +353,7 @@ static void part_print_amiga(struct blk_desc *dev_desc)
 
 	PRINTF("Trying to load block #0x%X\n", block);
 
-	res = blk_dread(dev_desc, block, 1, (ulong *)block_buffer);
+	res = blk_dread(desc, block, 1, (ulong *)block_buffer);
 	if (res == 1)
 	{
 	    p = (struct partition_block *)block_buffer;
@@ -370,7 +370,7 @@ static void part_print_amiga(struct blk_desc *dev_desc)
 	} else block = 0xFFFFFFFF;
     }
 
-    boot = get_bootcode(dev_desc);
+	boot = get_bootcode(desc);
     if (boot)
     {
 	printf("Disk is bootable\n");
-- 
2.41.0.640.ga95def55d0-goog


  parent reply	other threads:[~2023-08-13 14:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-13 14:26 [PATCH 00/24] bootstd: Support ChromiumOS better Simon Glass
2023-08-13 14:26 ` [PATCH 01/24] part: Use desc instead of dev_desc Simon Glass
2023-08-13 14:26 ` Simon Glass [this message]
2023-08-13 14:26 ` [PATCH 03/24] part: dos: " Simon Glass
2023-08-13 14:26 ` [PATCH 04/24] part: efi: " Simon Glass
2023-08-13 14:26 ` [PATCH 05/24] part: iso: " Simon Glass
2023-08-13 14:26 ` [PATCH 06/24] part: nac: " Simon Glass
2023-08-13 14:26 ` [PATCH 07/24] part: Add comments for static functions Simon Glass
2023-08-13 14:26 ` [PATCH 08/24] part: Add accessors for struct disk_partition uuid Simon Glass
2023-08-13 14:26 ` [PATCH 09/24] part: Add accessors for struct disk_partition type_uuid Simon Glass
2023-08-13 14:26 ` [PATCH 10/24] part: Add an accessor for struct disk_partition sys_ind Simon Glass
2023-08-13 14:26 ` [PATCH 11/24] part: efi: Add debugging for the signature check Simon Glass
2023-08-13 14:26 ` [PATCH 12/24] fs/erofs: Quieten test for filesystem presence Simon Glass
2023-08-14  3:45   ` Gao Xiang
2023-08-13 14:26 ` [PATCH 13/24] dm: core: Correct error handling when event fails Simon Glass
2023-08-13 14:26 ` [PATCH 14/24] uuid: Move function comments to header file Simon Glass
2023-08-13 14:26 ` [PATCH 15/24] sandbox: Add a way to access persistent test files Simon Glass
2023-08-13 14:26 ` [PATCH 16/24] test: Move 1MB.fat32.img and 2MB.ext2.img Simon Glass
2023-08-13 14:26 ` [PATCH 17/24] bootflow: Show an empty filename when there is none Simon Glass
2023-08-13 14:26 ` [PATCH 18/24] bootstd: test: Allow binding and using any mmc device Simon Glass
2023-08-13 14:26 ` [PATCH 19/24] bootstd: Add a test for bootmeth_cros Simon Glass
2023-08-13 14:26 ` [PATCH 20/24] part: Add a fallback for part_get_bootable() Simon Glass
2023-08-13 14:26 ` [PATCH 21/24] bootstd: Support bootmeths which can scan any partition Simon Glass
2023-08-13 14:26 ` [PATCH 22/24] uuid: Add ChromiumOS partition types Simon Glass
2023-08-13 14:26 ` [PATCH 23/24] bootstd: cros: Allow detection of any kernel partition Simon Glass
2023-08-13 14:26 ` [PATCH 24/24] CI: Add ChromiumOS utilities Simon Glass
2023-08-24 17:43 ` [PATCH 00/24] bootstd: Support ChromiumOS better Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230813142708.361456-3-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox