aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/dma/ioat.c11
-rw-r--r--drivers/dma/ioat_dma.c4
2 files changed, 7 insertions, 8 deletions
diff --git a/drivers/dma/ioat.c b/drivers/dma/ioat.c
index 54fdeb7c4945..a45872f32d50 100644
--- a/drivers/dma/ioat.c
+++ b/drivers/dma/ioat.c
@@ -71,7 +71,7 @@ static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
71 switch (version) { 71 switch (version) {
72 case IOAT_VER_1_2: 72 case IOAT_VER_1_2:
73 device->dma = ioat_dma_probe(pdev, iobase); 73 device->dma = ioat_dma_probe(pdev, iobase);
74 if (ioat_dca_enabled) 74 if (device->dma && ioat_dca_enabled)
75 device->dca = ioat_dca_init(pdev, iobase); 75 device->dca = ioat_dca_init(pdev, iobase);
76 break; 76 break;
77 default: 77 default:
@@ -85,17 +85,16 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev)
85{ 85{
86 struct ioat_device *device = pci_get_drvdata(pdev); 86 struct ioat_device *device = pci_get_drvdata(pdev);
87 87
88 if (device->dma) {
89 ioat_dma_remove(device->dma);
90 device->dma = NULL;
91 }
92
93 if (device->dca) { 88 if (device->dca) {
94 unregister_dca_provider(device->dca); 89 unregister_dca_provider(device->dca);
95 free_dca_provider(device->dca); 90 free_dca_provider(device->dca);
96 device->dca = NULL; 91 device->dca = NULL;
97 } 92 }
98 93
94 if (device->dma) {
95 ioat_dma_remove(device->dma);
96 device->dma = NULL;
97 }
99} 98}
100 99
101static struct pci_driver ioat_pci_driver = { 100static struct pci_driver ioat_pci_driver = {
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index 59d4344db005..725f83f3eeb3 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -941,10 +941,10 @@ void ioat_dma_remove(struct ioatdma_device *device)
941 struct dma_chan *chan, *_chan; 941 struct dma_chan *chan, *_chan;
942 struct ioat_dma_chan *ioat_chan; 942 struct ioat_dma_chan *ioat_chan;
943 943
944 dma_async_device_unregister(&device->common);
945
946 ioat_dma_remove_interrupts(device); 944 ioat_dma_remove_interrupts(device);
947 945
946 dma_async_device_unregister(&device->common);
947
948 pci_pool_destroy(device->dma_pool); 948 pci_pool_destroy(device->dma_pool);
949 pci_pool_destroy(device->completion_pool); 949 pci_pool_destroy(device->completion_pool);
950 950