diff options
author | Keith Busch <keith.busch@intel.com> | 2014-01-27 11:29:40 -0500 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2014-01-27 20:12:15 -0500 |
commit | 09ece1424f52a2d3ad0ab715e96b0fb342af4f03 (patch) | |
tree | 2011442081fd0fe6195df1747e74e60d0c9ac04f /drivers/block | |
parent | a1a5ef9998b1379780790b878457b0e0f48b25db (diff) |
NVMe: Add a pci_driver shutdown method
We need to shut down the device cleanly when the system is being shut down.
This was in an earlier patch but was inadvertently lost during a rewrite.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nvme-core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 89021d710ec2..eaace767be49 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
@@ -2554,6 +2554,12 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2554 | return result; | 2554 | return result; |
2555 | } | 2555 | } |
2556 | 2556 | ||
2557 | static void nvme_shutdown(struct pci_dev *pdev) | ||
2558 | { | ||
2559 | struct nvme_dev *dev = pci_get_drvdata(pdev); | ||
2560 | nvme_dev_shutdown(dev); | ||
2561 | } | ||
2562 | |||
2557 | static void nvme_remove(struct pci_dev *pdev) | 2563 | static void nvme_remove(struct pci_dev *pdev) |
2558 | { | 2564 | { |
2559 | struct nvme_dev *dev = pci_get_drvdata(pdev); | 2565 | struct nvme_dev *dev = pci_get_drvdata(pdev); |
@@ -2625,6 +2631,7 @@ static struct pci_driver nvme_driver = { | |||
2625 | .id_table = nvme_id_table, | 2631 | .id_table = nvme_id_table, |
2626 | .probe = nvme_probe, | 2632 | .probe = nvme_probe, |
2627 | .remove = nvme_remove, | 2633 | .remove = nvme_remove, |
2634 | .shutdown = nvme_shutdown, | ||
2628 | .driver = { | 2635 | .driver = { |
2629 | .pm = &nvme_dev_pm_ops, | 2636 | .pm = &nvme_dev_pm_ops, |
2630 | }, | 2637 | }, |