diff options
author | Shane Michael Matthews <shane.matthews@intel.com> | 2011-02-01 08:49:30 -0500 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2011-11-04 15:52:53 -0400 |
commit | 0ee5a7d7cb9309bd393a25c395f19fb12a842602 (patch) | |
tree | 4aae6ff2e536b735336f2216dfd2aa490b9c984a | |
parent | 3f85d50b609e8a5ef151656210203a6e94c19538 (diff) | |
download | blackbird-op-linux-0ee5a7d7cb9309bd393a25c395f19fb12a842602.tar.gz blackbird-op-linux-0ee5a7d7cb9309bd393a25c395f19fb12a842602.zip |
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>
-rw-r--r-- | drivers/block/nvme.c | 5 |
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, if (!dev->queues) goto free; + if (pci_enable_device_mem(pdev)) + goto free; + INIT_LIST_HEAD(&dev->namespaces); dev->pci_dev = pdev; pci_set_drvdata(pdev, dev); @@ -1133,6 +1136,7 @@ static int __devinit nvme_probe(struct pci_dev *pdev, disable: pci_disable_msix(pdev); nvme_release_instance(dev); + pci_disable_device(pdev); free: kfree(dev->queues); kfree(dev->entry); @@ -1147,6 +1151,7 @@ static void __devexit nvme_remove(struct pci_dev *pdev) pci_disable_msix(pdev); iounmap(dev->bar); nvme_release_instance(dev); + pci_disable_device(pdev); kfree(dev->queues); kfree(dev->entry); kfree(dev); |