summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--driver/base.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/driver/base.c b/driver/base.c
index 2b998e3..51dd1f4 100644
--- a/driver/base.c
+++ b/driver/base.c
@@ -259,11 +259,12 @@ init_alloc_fail:
*/
static void pcidriver_exit(void)
{
+ pci_unregister_driver(&pcidriver_driver);
+ unregister_chrdev_region(pcidriver_devt, MAXDEVICES);
+
if (pcidriver_class != NULL)
class_destroy(pcidriver_class);
- pci_unregister_driver(&pcidriver_driver);
- unregister_chrdev_region(pcidriver_devt, MAXDEVICES);
mod_info("Module unloaded\n");
}