[PATCH] nvme: Use pci_iomap instead of ioremap

Pankaj Raghav p.raghav at samsung.com
Fri Jan 21 06:35:33 PST 2022


Use the better checked pci_iomap instead of ioremap.

Signed-off-by: Pankaj Raghav <p.raghav at samsung.com>
---
 drivers/nvme/host/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index d8585df2c2fd..6c8aad9ff7db 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1800,7 +1800,7 @@ static int nvme_remap_bar(struct nvme_dev *dev, unsigned long size)
 		return -ENOMEM;
 	if (dev->bar)
 		iounmap(dev->bar);
-	dev->bar = ioremap(pci_resource_start(pdev, 0), size);
+	dev->bar = pci_iomap(pdev, 0, size);
 	if (!dev->bar) {
 		dev->bar_mapped_size = 0;
 		return -ENOMEM;
-- 
2.25.1




More information about the Linux-nvme mailing list