Skip to content

Commit

Permalink
NVMe: Enable and disable the PCI device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shane Michael Matthews authored and Matthew Wilcox committed Nov 4, 2011
1 parent 3f85d50 commit 0ee5a7d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/block/nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 0ee5a7d

Please sign in to comment.