From c812007f8cfe3af5b8acd3dbf3fa0343b6eedd3a Mon Sep 17 00:00:00 2001 From: guohao15 Date: Tue, 12 Sep 2023 11:54:40 +0800 Subject: [PATCH] mtd:use part->name as partition name when CONFIG_MTD_PARTITION_NAMES set Signed-off-by: guohao15 --- drivers/mtd/mtd_partition.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index 8d04be670a..4db75d92d1 100644 --- a/drivers/mtd/mtd_partition.c +++ b/drivers/mtd/mtd_partition.c @@ -909,8 +909,11 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd, #ifdef CONFIG_MTD_BYTE_WRITE part->child.write = mtd->write ? part_write : NULL; #endif +#ifdef CONFIG_MTD_PARTITION_NAMES + part->child.name = part->name; +#else part->child.name = "part"; - +#endif part->parent = mtd; part->firstblock = erasestart * part->blkpererase; part->geo.neraseblocks = eraseend - erasestart;