From 67215df9a8abf1e090b567fd2f4b550d1079ac3c Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Mon, 5 Jan 2004 05:39:29 -0800 Subject: [PATCH] [PATCH] fix oopses on rmmod in some OSS drivers Fix for oops on rmmod caused by *_remove() function marked as __devinit (and thus discarded after module initialization - if CONFIG_MODULES=y and CONFIG_HOTPLUG is not set). This patch changes __devinit to __devexit and adds __devexit_p() where pointer to such function is used. The only exception is au1000, where au1000_remove() is called from cleanup_au1000() function - __devinit is jest removed there. --- sound/oss/au1000.c | 2 +- sound/oss/cs4281/cs4281m.c | 4 ++-- sound/oss/cs46xx.c | 4 ++-- sound/oss/es1370.c | 4 ++-- sound/oss/es1371.c | 4 ++-- sound/oss/esssolo1.c | 4 ++-- sound/oss/ite8172.c | 4 ++-- sound/oss/nec_vrc5477.c | 4 ++-- sound/oss/rme96xx.c | 4 ++-- sound/oss/sonicvibes.c | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/sound/oss/au1000.c b/sound/oss/au1000.c index b08c699a9993a..74c007547f319 100644 --- a/sound/oss/au1000.c +++ b/sound/oss/au1000.c @@ -2177,7 +2177,7 @@ static int __devinit au1000_probe(void) return -1; } -static void __devinit au1000_remove(void) +static void au1000_remove(void) { struct au1000_state *s = &au1000_state; diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c index f0f175897df68..2f38ae7c88609 100644 --- a/sound/oss/cs4281/cs4281m.c +++ b/sound/oss/cs4281/cs4281m.c @@ -4435,7 +4435,7 @@ static int __devinit cs4281_probe(struct pci_dev *pcidev, // --------------------------------------------------------------------- -static void __devinit cs4281_remove(struct pci_dev *pci_dev) +static void __devexit cs4281_remove(struct pci_dev *pci_dev) { struct cs4281_state *s = pci_get_drvdata(pci_dev); // stop DMA controller @@ -4469,7 +4469,7 @@ struct pci_driver cs4281_pci_driver = { .name = "cs4281", .id_table = cs4281_pci_tbl, .probe = cs4281_probe, - .remove = cs4281_remove, + .remove = __devexit_p(cs4281_remove), .suspend = CS4281_SUSPEND_TBL, .resume = CS4281_RESUME_TBL, }; diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index 4b40e667c6f3d..110a6d3686488 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c @@ -5603,7 +5603,7 @@ fail2: // --------------------------------------------------------------------- -static void __devinit cs46xx_remove(struct pci_dev *pci_dev) +static void __devexit cs46xx_remove(struct pci_dev *pci_dev) { struct cs_card *card = PCI_GET_DRIVER_DATA(pci_dev); int i; @@ -5730,7 +5730,7 @@ struct pci_driver cs46xx_pci_driver = { .name = "cs46xx", .id_table = cs46xx_pci_tbl, .probe = cs46xx_probe, - .remove = cs46xx_remove, + .remove = __devexit_p(cs46xx_remove), .suspend = CS46XX_SUSPEND_TBL, .resume = CS46XX_RESUME_TBL, }; diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c index 6f00a9366d3d1..4478d7deefb45 100644 --- a/sound/oss/es1370.c +++ b/sound/oss/es1370.c @@ -2700,7 +2700,7 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic return ret; } -static void __devinit es1370_remove(struct pci_dev *dev) +static void __devexit es1370_remove(struct pci_dev *dev) { struct es1370_state *s = pci_get_drvdata(dev); @@ -2736,7 +2736,7 @@ static struct pci_driver es1370_driver = { .name = "es1370", .id_table = id_table, .probe = es1370_probe, - .remove = es1370_remove, + .remove = __devexit_p(es1370_remove), }; static int __init init_es1370(void) diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index 043ed790205c7..3cc4fb2e79ae2 100644 --- a/sound/oss/es1371.c +++ b/sound/oss/es1371.c @@ -3001,7 +3001,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic return res; } -static void __devinit es1371_remove(struct pci_dev *dev) +static void __devexit es1371_remove(struct pci_dev *dev) { struct es1371_state *s = pci_get_drvdata(dev); @@ -3043,7 +3043,7 @@ static struct pci_driver es1371_driver = { .name = "es1371", .id_table = id_table, .probe = es1371_probe, - .remove = es1371_remove, + .remove = __devexit_p(es1371_remove), }; static int __init init_es1371(void) diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c index 0ab2e4ba539c8..cbd78ed954fd0 100644 --- a/sound/oss/esssolo1.c +++ b/sound/oss/esssolo1.c @@ -2407,7 +2407,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device return ret; } -static void __devinit solo1_remove(struct pci_dev *dev) +static void __devexit solo1_remove(struct pci_dev *dev) { struct solo1_state *s = pci_get_drvdata(dev); @@ -2447,7 +2447,7 @@ static struct pci_driver solo1_driver = { .name = "ESS Solo1", .id_table = id_table, .probe = solo1_probe, - .remove = solo1_remove, + .remove = __devexit_p(solo1_remove), .suspend = solo1_suspend, .resume = solo1_resume, }; diff --git a/sound/oss/ite8172.c b/sound/oss/ite8172.c index 11151903df607..8c8fe0790cdd6 100644 --- a/sound/oss/ite8172.c +++ b/sound/oss/ite8172.c @@ -2165,7 +2165,7 @@ static int __devinit it8172_probe(struct pci_dev *pcidev, return -1; } -static void __devinit it8172_remove(struct pci_dev *dev) +static void __devexit it8172_remove(struct pci_dev *dev) { struct it8172_state *s = pci_get_drvdata(dev); @@ -2200,7 +2200,7 @@ static struct pci_driver it8172_driver = { .name = IT8172_MODULE_NAME, .id_table = id_table, .probe = it8172_probe, - .remove = it8172_remove + .remove = __devexit_p(it8172_remove) }; static int __init init_it8172(void) diff --git a/sound/oss/nec_vrc5477.c b/sound/oss/nec_vrc5477.c index cb76b797575ab..7c7af9527714c 100644 --- a/sound/oss/nec_vrc5477.c +++ b/sound/oss/nec_vrc5477.c @@ -1964,7 +1964,7 @@ static int __devinit vrc5477_ac97_probe(struct pci_dev *pcidev, return -1; } -static void __devinit vrc5477_ac97_remove(struct pci_dev *dev) +static void __devexit vrc5477_ac97_remove(struct pci_dev *dev) { struct vrc5477_ac97_state *s = pci_get_drvdata(dev); @@ -2000,7 +2000,7 @@ static struct pci_driver vrc5477_ac97_driver = { .name = VRC5477_AC97_MODULE_NAME, .id_table = id_table, .probe = vrc5477_ac97_probe, - .remove = vrc5477_ac97_remove, + .remove = __devexit_p(vrc5477_ac97_remove), }; static int __init init_vrc5477_ac97(void) diff --git a/sound/oss/rme96xx.c b/sound/oss/rme96xx.c index c684ba956a91f..5195a535b5de3 100644 --- a/sound/oss/rme96xx.c +++ b/sound/oss/rme96xx.c @@ -1033,7 +1033,7 @@ static int __devinit rme96xx_probe(struct pci_dev *pcidev, const struct pci_devi } -static void __devinit rme96xx_remove(struct pci_dev *dev) +static void __devexit rme96xx_remove(struct pci_dev *dev) { int i; rme96xx_info *s = pci_get_drvdata(dev); @@ -1087,7 +1087,7 @@ static struct pci_driver rme96xx_driver = { .name = "rme96xx", .id_table = id_table, .probe = rme96xx_probe, - .remove = rme96xx_remove, + .remove = __devexit_p(rme96xx_remove), }; static int __init init_rme96xx(void) diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c index 904eaf1fd2cf1..9bb3596c77fe0 100644 --- a/sound/oss/sonicvibes.c +++ b/sound/oss/sonicvibes.c @@ -2678,7 +2678,7 @@ static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id return ret; } -static void __devinit sv_remove(struct pci_dev *dev) +static void __devexit sv_remove(struct pci_dev *dev) { struct sv_state *s = pci_get_drvdata(dev); @@ -2720,7 +2720,7 @@ static struct pci_driver sv_driver = { .name = "sonicvibes", .id_table = id_table, .probe = sv_probe, - .remove = sv_remove, + .remove = __devexit_p(sv_remove), }; static int __init init_sonicvibes(void) -- 2.53.0