You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/05/01 19:47:08 UTC
[nuttx] 01/03: mtd/nand: Call nandmodel_getdevpagesize directly to get the page number
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit c1680d2f03574f3780fa08a078f696603f4d820b
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon May 1 01:05:33 2023 +0800
mtd/nand: Call nandmodel_getdevpagesize directly to get the page number
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
drivers/mtd/mtd_nand.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mtd/mtd_nand.c b/drivers/mtd/mtd_nand.c
index eabee860a5..4e44d8ace3 100644
--- a/drivers/mtd/mtd_nand.c
+++ b/drivers/mtd/mtd_nand.c
@@ -782,9 +782,7 @@ static int nand_ioctl(struct mtd_dev_s *dev, int cmd, unsigned long arg)
(FAR struct partition_info_s *)arg;
if (info != NULL)
{
- info->numsectors = nandmodel_getdevblocks(model) *
- nandmodel_getbyteblocksize(model) /
- model->pagesize;
+ info->numsectors = nandmodel_getdevpagesize(model);
info->sectorsize = model->pagesize;
info->startsector = 0;
info->parent[0] = '\0';