aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/ioat.c')
-rw-r--r--drivers/dma/ioat.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/dma/ioat.c b/drivers/dma/ioat.c
index f7276bf2fe7e..54fdeb7c4945 100644
--- a/drivers/dma/ioat.c
+++ b/drivers/dma/ioat.c
@@ -55,9 +55,7 @@ struct ioat_device {
55 55
56static int __devinit ioat_probe(struct pci_dev *pdev, 56static int __devinit ioat_probe(struct pci_dev *pdev,
57 const struct pci_device_id *id); 57 const struct pci_device_id *id);
58#ifdef IOAT_DMA_REMOVE
59static void __devexit ioat_remove(struct pci_dev *pdev); 58static void __devexit ioat_remove(struct pci_dev *pdev);
60#endif
61 59
62static int ioat_dca_enabled = 1; 60static int ioat_dca_enabled = 1;
63module_param(ioat_dca_enabled, int, 0644); 61module_param(ioat_dca_enabled, int, 0644);
@@ -100,14 +98,12 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev)
100 98
101} 99}
102 100
103static struct pci_driver ioat_pci_drv = { 101static struct pci_driver ioat_pci_driver = {
104 .name = "ioatdma", 102 .name = "ioatdma",
105 .id_table = ioat_pci_tbl, 103 .id_table = ioat_pci_tbl,
106 .probe = ioat_probe, 104 .probe = ioat_probe,
107 .shutdown = ioat_shutdown_functionality, 105 .shutdown = ioat_shutdown_functionality,
108#ifdef IOAT_DMA_REMOVE
109 .remove = __devexit_p(ioat_remove), 106 .remove = __devexit_p(ioat_remove),
110#endif
111}; 107};
112 108
113static int __devinit ioat_probe(struct pci_dev *pdev, 109static int __devinit ioat_probe(struct pci_dev *pdev,
@@ -122,7 +118,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
122 if (err) 118 if (err)
123 goto err_enable_device; 119 goto err_enable_device;
124 120
125 err = pci_request_regions(pdev, ioat_pci_drv.name); 121 err = pci_request_regions(pdev, ioat_pci_driver.name);
126 if (err) 122 if (err)
127 goto err_request_regions; 123 goto err_request_regions;
128 124
@@ -176,13 +172,11 @@ err_enable_device:
176 return err; 172 return err;
177} 173}
178 174
179#ifdef IOAT_DMA_REMOVE
180/* 175/*
181 * It is unsafe to remove this module: if removed while a requested 176 * It is unsafe to remove this module: if removed while a requested
182 * dma is outstanding, esp. from tcp, it is possible to hang while 177 * dma is outstanding, esp. from tcp, it is possible to hang while
183 * waiting for something that will never finish, thus hanging at 178 * waiting for something that will never finish. However, if you're
184 * least one cpu. However, if you're feeling lucky and need to do 179 * feeling lucky, this usually works just fine.
185 * some testing, this usually works just fine.
186 */ 180 */
187static void __devexit ioat_remove(struct pci_dev *pdev) 181static void __devexit ioat_remove(struct pci_dev *pdev)
188{ 182{
@@ -191,21 +185,16 @@ static void __devexit ioat_remove(struct pci_dev *pdev)
191 ioat_shutdown_functionality(pdev); 185 ioat_shutdown_functionality(pdev);
192 186
193 kfree(device); 187 kfree(device);
194
195 iounmap(device->iobase);
196 pci_release_regions(pdev);
197 pci_disable_device(pdev);
198} 188}
199#endif
200 189
201static int __init ioat_init_module(void) 190static int __init ioat_init_module(void)
202{ 191{
203 return pci_register_driver(&ioat_pci_drv); 192 return pci_register_driver(&ioat_pci_driver);
204} 193}
205module_init(ioat_init_module); 194module_init(ioat_init_module);
206 195
207static void __exit ioat_exit_module(void) 196static void __exit ioat_exit_module(void)
208{ 197{
209 pci_unregister_driver(&ioat_pci_drv); 198 pci_unregister_driver(&ioat_pci_driver);
210} 199}
211module_exit(ioat_exit_module); 200module_exit(ioat_exit_module);