summaryrefslogtreecommitdiff
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorMatias Bjørling <mb@lightnvm.io>2018-03-30 01:05:01 +0300
committerJens Axboe <axboe@kernel.dk>2018-03-30 02:29:09 +0300
commitc6ac3f35d46b3c9999838dd13e7e113674f22ffa (patch)
tree136dc460d0d804c71d5093c85d7fc1b5f1e0955b /drivers/lightnvm
parenta04e0cf93aee6b5e59e84ab66253f09eb71d621b (diff)
downloadlinux-c6ac3f35d46b3c9999838dd13e7e113674f22ffa.tar.xz
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 <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/core.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 5f1988df1593..db4a1b8f1561 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -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;