1 Fix for oops on rmmod caused by *_remove() function marked as __devinit
2 (and thus discarded after module initialization - if CONFIG_MODULES=y
3 and CONFIG_HOTPLUG is not set).
4 This patch changes __devinit to __devexit and adds __devexit_p() where
5 pointer to such function is used.
7 The only exception is au1000, where au1000_remove() is called from
8 cleanup_au1000() function - __devinit is jest removed there.
10 -- Jakub Bogusz <qboosh@pld-linux.org>
12 --- linux-2.6.0-test11/sound/oss/cs4281/cs4281m.c.orig 2003-11-26 21:45:53.000000000 +0100
13 +++ linux-2.6.0-test11/sound/oss/cs4281/cs4281m.c 2003-12-05 23:39:46.823135264 +0100
16 // ---------------------------------------------------------------------
18 -static void __devinit cs4281_remove(struct pci_dev *pci_dev)
19 +static void __devexit cs4281_remove(struct pci_dev *pci_dev)
21 struct cs4281_state *s = pci_get_drvdata(pci_dev);
22 // stop DMA controller
25 .id_table = cs4281_pci_tbl,
26 .probe = cs4281_probe,
27 - .remove = cs4281_remove,
28 + .remove = __devexit_p(cs4281_remove),
29 .suspend = CS4281_SUSPEND_TBL,
30 .resume = CS4281_RESUME_TBL,
32 --- linux-2.6.0-test11/sound/oss/cs46xx.c.orig 2003-11-26 21:42:47.000000000 +0100
33 +++ linux-2.6.0-test11/sound/oss/cs46xx.c 2003-12-05 23:29:58.702543184 +0100
36 // ---------------------------------------------------------------------
38 -static void __devinit cs46xx_remove(struct pci_dev *pci_dev)
39 +static void __devexit cs46xx_remove(struct pci_dev *pci_dev)
41 struct cs_card *card = PCI_GET_DRIVER_DATA(pci_dev);
45 .id_table = cs46xx_pci_tbl,
46 .probe = cs46xx_probe,
47 - .remove = cs46xx_remove,
48 + .remove = __devexit_p(cs46xx_remove),
49 .suspend = CS46XX_SUSPEND_TBL,
50 .resume = CS46XX_RESUME_TBL,
52 --- linux-2.6.0-test11/sound/oss/esssolo1.c.orig 2003-11-26 21:43:06.000000000 +0100
53 +++ linux-2.6.0-test11/sound/oss/esssolo1.c 2003-12-05 23:30:40.015262696 +0100
58 -static void __devinit solo1_remove(struct pci_dev *dev)
59 +static void __devexit solo1_remove(struct pci_dev *dev)
61 struct solo1_state *s = pci_get_drvdata(dev);
67 - .remove = solo1_remove,
68 + .remove = __devexit_p(solo1_remove),
69 .suspend = solo1_suspend,
70 .resume = solo1_resume,
72 --- linux-2.6.0-test11/sound/oss/ite8172.c.orig 2003-11-26 21:43:24.000000000 +0100
73 +++ linux-2.6.0-test11/sound/oss/ite8172.c 2003-12-05 23:31:34.154032352 +0100
78 -static void __devinit it8172_remove(struct pci_dev *dev)
79 +static void __devexit it8172_remove(struct pci_dev *dev)
81 struct it8172_state *s = pci_get_drvdata(dev);
84 .name = IT8172_MODULE_NAME,
86 .probe = it8172_probe,
87 - .remove = it8172_remove
88 + .remove = __devexit_p(it8172_remove)
91 static int __init init_it8172(void)
92 --- linux-2.6.0-test11/sound/oss/rme96xx.c.orig 2003-11-26 21:43:36.000000000 +0100
93 +++ linux-2.6.0-test11/sound/oss/rme96xx.c 2003-12-05 23:32:24.956309232 +0100
98 -static void __devinit rme96xx_remove(struct pci_dev *dev)
99 +static void __devexit rme96xx_remove(struct pci_dev *dev)
102 rme96xx_info *s = pci_get_drvdata(dev);
103 @@ -1087,7 +1087,7 @@
105 .id_table = id_table,
106 .probe = rme96xx_probe,
107 - .remove = rme96xx_remove,
108 + .remove = __devexit_p(rme96xx_remove),
111 static int __init init_rme96xx(void)
112 --- linux-2.6.0-test11/sound/oss/au1000.c.orig 2003-11-26 21:44:41.000000000 +0100
113 +++ linux-2.6.0-test11/sound/oss/au1000.c 2003-12-05 23:35:42.252315680 +0100
114 @@ -2177,7 +2177,7 @@
118 -static void __devinit au1000_remove(void)
119 +static void au1000_remove(void)
121 struct au1000_state *s = &au1000_state;
123 --- linux-2.6.0-test11/sound/oss/sonicvibes.c.orig 2003-11-26 21:43:51.000000000 +0100
124 +++ linux-2.6.0-test11/sound/oss/sonicvibes.c 2003-12-05 23:32:51.911211464 +0100
125 @@ -2678,7 +2678,7 @@
129 -static void __devinit sv_remove(struct pci_dev *dev)
130 +static void __devexit sv_remove(struct pci_dev *dev)
132 struct sv_state *s = pci_get_drvdata(dev);
134 @@ -2720,7 +2720,7 @@
135 .name = "sonicvibes",
136 .id_table = id_table,
138 - .remove = sv_remove,
139 + .remove = __devexit_p(sv_remove),
142 static int __init init_sonicvibes(void)
143 --- linux-2.6.0-test11/sound/oss/nec_vrc5477.c.orig 2003-11-26 21:44:59.000000000 +0100
144 +++ linux-2.6.0-test11/sound/oss/nec_vrc5477.c 2003-12-05 23:36:07.803431320 +0100
145 @@ -1964,7 +1964,7 @@
149 -static void __devinit vrc5477_ac97_remove(struct pci_dev *dev)
150 +static void __devexit vrc5477_ac97_remove(struct pci_dev *dev)
152 struct vrc5477_ac97_state *s = pci_get_drvdata(dev);
154 @@ -2000,7 +2000,7 @@
155 .name = VRC5477_AC97_MODULE_NAME,
156 .id_table = id_table,
157 .probe = vrc5477_ac97_probe,
158 - .remove = vrc5477_ac97_remove,
159 + .remove = __devexit_p(vrc5477_ac97_remove),
162 static int __init init_vrc5477_ac97(void)
163 --- linux-2.6.0-test11/sound/oss/es1371.c.orig 2003-11-26 21:44:59.000000000 +0100
164 +++ linux-2.6.0-test11/sound/oss/es1371.c 2003-12-05 23:36:28.527280816 +0100
165 @@ -3001,7 +3001,7 @@
169 -static void __devinit es1371_remove(struct pci_dev *dev)
170 +static void __devexit es1371_remove(struct pci_dev *dev)
172 struct es1371_state *s = pci_get_drvdata(dev);
174 @@ -3043,7 +3043,7 @@
176 .id_table = id_table,
177 .probe = es1371_probe,
178 - .remove = es1371_remove,
179 + .remove = __devexit_p(es1371_remove),
182 static int __init init_es1371(void)
183 --- linux-2.6.0-test11/sound/oss/es1370.c.orig 2003-11-26 21:46:01.000000000 +0100
184 +++ linux-2.6.0-test11/sound/oss/es1370.c 2003-12-05 23:36:47.907334600 +0100
185 @@ -2700,7 +2700,7 @@
189 -static void __devinit es1370_remove(struct pci_dev *dev)
190 +static void __devexit es1370_remove(struct pci_dev *dev)
192 struct es1370_state *s = pci_get_drvdata(dev);
194 @@ -2736,7 +2736,7 @@
196 .id_table = id_table,
197 .probe = es1370_probe,
198 - .remove = es1370_remove,
199 + .remove = __devexit_p(es1370_remove),
202 static int __init init_es1370(void)