mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
lightnvm: flatten nvm_id_group into nvm_id
There are no groups in the 2.0 specification, make sure that the nvm_id structure is flattened before 2.0 data structures are added. Signed-off-by: Matias Bjørling <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
a04e0cf93a
commit
c6ac3f35d4
3 changed files with 89 additions and 95 deletions
|
|
@ -851,33 +851,32 @@ EXPORT_SYMBOL(nvm_get_tgt_bb_tbl);
|
|||
static int nvm_core_init(struct nvm_dev *dev)
|
||||
{
|
||||
struct nvm_id *id = &dev->identity;
|
||||
struct nvm_id_group *grp = &id->grp;
|
||||
struct nvm_geo *geo = &dev->geo;
|
||||
int ret;
|
||||
|
||||
memcpy(&geo->ppaf, &id->ppaf, sizeof(struct nvm_addr_format));
|
||||
|
||||
if (grp->mtype != 0) {
|
||||
if (id->mtype != 0) {
|
||||
pr_err("nvm: memory type not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Whole device values */
|
||||
geo->nr_chnls = grp->num_ch;
|
||||
geo->nr_luns = grp->num_lun;
|
||||
geo->nr_chnls = id->num_ch;
|
||||
geo->nr_luns = id->num_lun;
|
||||
|
||||
/* Generic device geometry values */
|
||||
geo->ws_min = grp->ws_min;
|
||||
geo->ws_opt = grp->ws_opt;
|
||||
geo->ws_seq = grp->ws_seq;
|
||||
geo->ws_per_chk = grp->ws_per_chk;
|
||||
geo->nr_chks = grp->num_chk;
|
||||
geo->sec_size = grp->csecs;
|
||||
geo->oob_size = grp->sos;
|
||||
geo->mccap = grp->mccap;
|
||||
geo->ws_min = id->ws_min;
|
||||
geo->ws_opt = id->ws_opt;
|
||||
geo->ws_seq = id->ws_seq;
|
||||
geo->ws_per_chk = id->ws_per_chk;
|
||||
geo->nr_chks = id->num_chk;
|
||||
geo->sec_size = id->csecs;
|
||||
geo->oob_size = id->sos;
|
||||
geo->mccap = id->mccap;
|
||||
geo->max_rq_size = dev->ops->max_phys_sect * geo->sec_size;
|
||||
|
||||
geo->sec_per_chk = grp->clba;
|
||||
geo->sec_per_chk = id->clba;
|
||||
geo->sec_per_lun = geo->sec_per_chk * geo->nr_chks;
|
||||
geo->all_luns = geo->nr_luns * geo->nr_chnls;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue