diff options
author | Christoph Hellwig <hch@lst.de> | 2015-11-20 08:58:10 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-12-01 10:59:38 -0700 |
commit | 7a67cbea653e444d04d7e850ab9631a14a196422 (patch) | |
tree | c0b7278210ef57355daf1090cc0a51225160bedc /drivers/nvme/host/scsi.c | |
parent | 21d34711e1b5970acfb22bddf1fefbfbd7e0123b (diff) | |
download | op-kernel-dev-7a67cbea653e444d04d7e850ab9631a14a196422.zip op-kernel-dev-7a67cbea653e444d04d7e850ab9631a14a196422.tar.gz |
nvme: use offset instead of a struct for registers
This makes life easier for future non-PCI drivers where access to the
registers might be more complicated. Note that Linux drivers are
pretty evenly split between the two versions, and in fact the NVMe
driver already uses offsets for the doorbells.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Keith Busch <keith.busch@intel.com>
[Fixed CMBSZ offset]
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/scsi.c')
-rw-r--r-- | drivers/nvme/host/scsi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c index c3d8d38..8586994 100644 --- a/drivers/nvme/host/scsi.c +++ b/drivers/nvme/host/scsi.c @@ -611,7 +611,7 @@ static int nvme_trans_device_id_page(struct nvme_ns *ns, struct sg_io_hdr *hdr, memset(inq_response, 0, alloc_len); inq_response[1] = INQ_DEVICE_IDENTIFICATION_PAGE; /* Page Code */ - if (readl(&dev->bar->vs) >= NVME_VS(1, 1)) { + if (readl(dev->bar + NVME_REG_VS) >= NVME_VS(1, 1)) { struct nvme_id_ns *id_ns; void *eui; int len; @@ -623,7 +623,7 @@ static int nvme_trans_device_id_page(struct nvme_ns *ns, struct sg_io_hdr *hdr, eui = id_ns->eui64; len = sizeof(id_ns->eui64); - if (readl(&dev->bar->vs) >= NVME_VS(1, 2)) { + if (readl(dev->bar + NVME_REG_VS) >= NVME_VS(1, 2)) { if (bitmap_empty(eui, len * 8)) { eui = id_ns->nguid; len = sizeof(id_ns->nguid); @@ -2297,7 +2297,7 @@ static int nvme_trans_test_unit_ready(struct nvme_ns *ns, { struct nvme_dev *dev = ns->dev; - if (!(readl(&dev->bar->csts) & NVME_CSTS_RDY)) + if (!(readl(dev->bar + NVME_REG_CSTS) & NVME_CSTS_RDY)) return nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, NOT_READY, SCSI_ASC_LUN_NOT_READY, SCSI_ASCQ_CAUSE_NOT_REPORTABLE); |