From 84c7897cf5a13a6bae63b49f65a6e72114dec44a Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Sun, 22 Jun 2008 13:52:31 +0000 Subject: fixing damage caused by r4445... the unregister_chrdev() call was *not* removed in r4436, it was moved to the top of the function so that we remove all possible paths opening devices provided by this module as early as possible in the unload process. however, while fixing this i realized that the class_unregister_device() calls need to happen before unregister_chrdev(), so those are now at the top of the function as well git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4447 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index f9c011d..c597c2b 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -7668,6 +7668,12 @@ static int __init dahdi_init(void) { static void __exit dahdi_cleanup(void) { int x; + class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 253)); /* timer */ + class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 254)); /* channel */ + class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 255)); /* pseudo */ + class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 0)); /* ctl */ + class_destroy(dahdi_class); + unregister_chrdev(DAHDI_MAJOR, "dahdi"); #ifdef CONFIG_PROC_FS @@ -7680,14 +7686,6 @@ static void __exit dahdi_cleanup(void) { kfree(tone_zones[x]); } - class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 253)); /* timer */ - class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 254)); /* channel */ - class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 255)); /* pseudo */ - class_device_destroy(dahdi_class, MKDEV(DAHDI_MAJOR, 0)); /* ctl */ - class_destroy(dahdi_class); - - unregister_chrdev(DAHDI_MAJOR, "dahdi"); - #ifdef CONFIG_DAHDI_WATCHDOG watchdog_cleanup(); #endif -- cgit v1.2.3