Commit 46b01d7e authored by Boris Brezillon's avatar Boris Brezillon Committed by Miquel Raynal

mtd: nand: Add a helper to retrieve the number of pages per target

Will be used by the raw NAND framework.
Signed-off-by: default avatarBoris Brezillon <bbrezillon@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarFrieder Schrempf <frieder.schrempf@kontron.de>
parent 7c4ecca1
...@@ -271,6 +271,20 @@ nanddev_pages_per_eraseblock(const struct nand_device *nand) ...@@ -271,6 +271,20 @@ nanddev_pages_per_eraseblock(const struct nand_device *nand)
return nand->memorg.pages_per_eraseblock; return nand->memorg.pages_per_eraseblock;
} }
/**
* nanddev_pages_per_target() - Get the number of pages per target
* @nand: NAND device
*
* Return: the number of pages per target.
*/
static inline unsigned int
nanddev_pages_per_target(const struct nand_device *nand)
{
return nand->memorg.pages_per_eraseblock *
nand->memorg.eraseblocks_per_lun *
nand->memorg.luns_per_target;
}
/** /**
* nanddev_per_page_oobsize() - Get NAND erase block size * nanddev_per_page_oobsize() - Get NAND erase block size
* @nand: NAND device * @nand: NAND device
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment