aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/nvme.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 40fb2e1bdfe4..12e37c1cf057 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -58,6 +58,9 @@ struct nvme_dev {
58 struct msix_entry *entry; 58 struct msix_entry *entry;
59 struct nvme_bar __iomem *bar; 59 struct nvme_bar __iomem *bar;
60 struct list_head namespaces; 60 struct list_head namespaces;
61 char serial[20];
62 char model[40];
63 char firmware_rev[8];
61}; 64};
62 65
63/* 66/*
@@ -979,6 +982,7 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev)
979{ 982{
980 int res, nn, i; 983 int res, nn, i;
981 struct nvme_ns *ns, *next; 984 struct nvme_ns *ns, *next;
985 struct nvme_id_ctrl *ctrl;
982 void *id; 986 void *id;
983 dma_addr_t dma_addr; 987 dma_addr_t dma_addr;
984 struct nvme_command cid, crt; 988 struct nvme_command cid, crt;
@@ -1003,7 +1007,11 @@ static int __devinit nvme_dev_add(struct nvme_dev *dev)
1003 goto out_free; 1007 goto out_free;
1004 } 1008 }
1005 1009
1006 nn = le32_to_cpup(&((struct nvme_id_ctrl *)id)->nn); 1010 ctrl = id;
1011 nn = le32_to_cpup(&ctrl->nn);
1012 memcpy(dev->serial, ctrl->sn, sizeof(ctrl->sn));
1013 memcpy(dev->model, ctrl->mn, sizeof(ctrl->mn));
1014 memcpy(dev->firmware_rev, ctrl->fr, sizeof(ctrl->fr));
1007 1015
1008 cid.identify.cns = 0; 1016 cid.identify.cns = 0;
1009 memset(&crt, 0, sizeof(crt)); 1017 memset(&crt, 0, sizeof(crt));