aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorShane Michael Matthews <shane.matthews@intel.com>2011-02-01 08:49:30 -0500
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2011-11-04 15:52:53 -0400
commit0ee5a7d7cb9309bd393a25c395f19fb12a842602 (patch)
tree4aae6ff2e536b735336f2216dfd2aa490b9c984a /drivers
parent3f85d50b609e8a5ef151656210203a6e94c19538 (diff)
NVMe: Enable and disable the PCI device
Call pci_enable_device_mem() at initialisation and pci_disable_device at exit. Signed-off-by: Shane Michael Matthews <shane.matthews@intel.com> Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/nvme.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index dc821776be94..1dda4b5c2302 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -1103,6 +1103,9 @@ static int __devinit nvme_probe(struct pci_dev *pdev,
1103 if (!dev->queues) 1103 if (!dev->queues)
1104 goto free; 1104 goto free;
1105 1105
1106 if (pci_enable_device_mem(pdev))
1107 goto free;
1108
1106 INIT_LIST_HEAD(&dev->namespaces); 1109 INIT_LIST_HEAD(&dev->namespaces);
1107 dev->pci_dev = pdev; 1110 dev->pci_dev = pdev;
1108 pci_set_drvdata(pdev, dev); 1111 pci_set_drvdata(pdev, dev);
@@ -1133,6 +1136,7 @@ static int __devinit nvme_probe(struct pci_dev *pdev,
1133 disable: 1136 disable:
1134 pci_disable_msix(pdev); 1137 pci_disable_msix(pdev);
1135 nvme_release_instance(dev); 1138 nvme_release_instance(dev);
1139 pci_disable_device(pdev);
1136 free: 1140 free:
1137 kfree(dev->queues); 1141 kfree(dev->queues);
1138 kfree(dev->entry); 1142 kfree(dev->entry);
@@ -1147,6 +1151,7 @@ static void __devexit nvme_remove(struct pci_dev *pdev)
1147 pci_disable_msix(pdev); 1151 pci_disable_msix(pdev);
1148 iounmap(dev->bar); 1152 iounmap(dev->bar);
1149 nvme_release_instance(dev); 1153 nvme_release_instance(dev);
1154 pci_disable_device(pdev);
1150 kfree(dev->queues); 1155 kfree(dev->queues);
1151 kfree(dev->entry); 1156 kfree(dev->entry);
1152 kfree(dev); 1157 kfree(dev);