mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: only count partitions from partition table
@ 2025-04-30 12:10 Michael Tretter
  2025-04-30 12:25 ` Ahmad Fatoum
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Tretter @ 2025-04-30 12:10 UTC (permalink / raw)
  To: barebox; +Cc: Michael Tretter

Linux is only aware of partitions in the partition table, but the list
of partitions in barebox may contain additional partitions, e.g., for
state or the environment.

Ignore partitions that are not in the partition table when calculating
the index of the partition in Linux.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 drivers/mci/mci-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index c4830a47a5f4..592543faa7b8 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -2550,7 +2550,8 @@ static char *mci_get_linux_mmcblkdev(struct block_device *blk,
 		 */
 		if (cdev_partname_equal(partcdev, cdev))
 			return basprintf("root=/dev/mmcblk%dp%d", id, partnum);
-		partnum++;
+		if (cdev->flags & DEVFS_PARTITION_FROM_TABLE)
+			partnum++;
 	}
 
 	return NULL;
-- 
2.39.5




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

end of thread, other threads:[~2025-04-30 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-30 12:10 [PATCH] mci: only count partitions from partition table Michael Tretter
2025-04-30 12:25 ` Ahmad Fatoum

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