mtd:use part->name as partition name when CONFIG_MTD_PARTITION_NAMES set

Signed-off-by: guohao15 <guohao15@xiaomi.com>
This commit is contained in:
guohao15 2023-09-12 11:54:40 +08:00 committed by Alan Carvalho de Assis
parent b3e511c5a8
commit c812007f8c
1 changed files with 4 additions and 1 deletions

View File

@ -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;