static int nvm_core_init(struct nvm_dev *dev)
{
...
dev->sec_per_pg = grp->fpg_sz / grp->csecs;
...
/* calculated values */
dev->sec_per_pl = dev->sec_per_pg * dev->nr_planes;
dev->sec_per_blk = dev->sec_per_pl * dev->pgs_per_blk;
dev->sec_per_lun = dev->sec_per_blk * dev->blks_per_lun;
...
}
static int rrpc_luns_init(struct rrpc *rrpc, int lun_begin, int lun_end)
{
...
for (i = 0; i < rrpc->nr_luns; i++) {
...
rrpc->nr_pages += dev->sec_per_lun;
...
}
...
}
I prefer rrpc->nr_pages to be the number of pages allocated to rrpc,
but the code above indeed make me confuse about the sec and page
thing.
Hope I'm not misunderstand the code.
ps: I'm not an expert on flash, if the confusion is caused by lack of
knowledge about flash, pleas let me know.