Commit 67215df9 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[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.
parent 00c45815
...@@ -2177,7 +2177,7 @@ static int __devinit au1000_probe(void) ...@@ -2177,7 +2177,7 @@ static int __devinit au1000_probe(void)
return -1; return -1;
} }
static void __devinit au1000_remove(void) static void au1000_remove(void)
{ {
struct au1000_state *s = &au1000_state; struct au1000_state *s = &au1000_state;
......
...@@ -4435,7 +4435,7 @@ static int __devinit cs4281_probe(struct pci_dev *pcidev, ...@@ -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); struct cs4281_state *s = pci_get_drvdata(pci_dev);
// stop DMA controller // stop DMA controller
...@@ -4469,7 +4469,7 @@ struct pci_driver cs4281_pci_driver = { ...@@ -4469,7 +4469,7 @@ struct pci_driver cs4281_pci_driver = {
.name = "cs4281", .name = "cs4281",
.id_table = cs4281_pci_tbl, .id_table = cs4281_pci_tbl,
.probe = cs4281_probe, .probe = cs4281_probe,
.remove = cs4281_remove, .remove = __devexit_p(cs4281_remove),
.suspend = CS4281_SUSPEND_TBL, .suspend = CS4281_SUSPEND_TBL,
.resume = CS4281_RESUME_TBL, .resume = CS4281_RESUME_TBL,
}; };
......
...@@ -5603,7 +5603,7 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev, ...@@ -5603,7 +5603,7 @@ static int __devinit cs46xx_probe(struct pci_dev *pci_dev,
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
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); struct cs_card *card = PCI_GET_DRIVER_DATA(pci_dev);
int i; int i;
...@@ -5730,7 +5730,7 @@ struct pci_driver cs46xx_pci_driver = { ...@@ -5730,7 +5730,7 @@ struct pci_driver cs46xx_pci_driver = {
.name = "cs46xx", .name = "cs46xx",
.id_table = cs46xx_pci_tbl, .id_table = cs46xx_pci_tbl,
.probe = cs46xx_probe, .probe = cs46xx_probe,
.remove = cs46xx_remove, .remove = __devexit_p(cs46xx_remove),
.suspend = CS46XX_SUSPEND_TBL, .suspend = CS46XX_SUSPEND_TBL,
.resume = CS46XX_RESUME_TBL, .resume = CS46XX_RESUME_TBL,
}; };
......
...@@ -2700,7 +2700,7 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic ...@@ -2700,7 +2700,7 @@ static int __devinit es1370_probe(struct pci_dev *pcidev, const struct pci_devic
return ret; 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); struct es1370_state *s = pci_get_drvdata(dev);
...@@ -2736,7 +2736,7 @@ static struct pci_driver es1370_driver = { ...@@ -2736,7 +2736,7 @@ static struct pci_driver es1370_driver = {
.name = "es1370", .name = "es1370",
.id_table = id_table, .id_table = id_table,
.probe = es1370_probe, .probe = es1370_probe,
.remove = es1370_remove, .remove = __devexit_p(es1370_remove),
}; };
static int __init init_es1370(void) static int __init init_es1370(void)
......
...@@ -3001,7 +3001,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic ...@@ -3001,7 +3001,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic
return res; 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); struct es1371_state *s = pci_get_drvdata(dev);
...@@ -3043,7 +3043,7 @@ static struct pci_driver es1371_driver = { ...@@ -3043,7 +3043,7 @@ static struct pci_driver es1371_driver = {
.name = "es1371", .name = "es1371",
.id_table = id_table, .id_table = id_table,
.probe = es1371_probe, .probe = es1371_probe,
.remove = es1371_remove, .remove = __devexit_p(es1371_remove),
}; };
static int __init init_es1371(void) static int __init init_es1371(void)
......
...@@ -2407,7 +2407,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device ...@@ -2407,7 +2407,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device
return ret; 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); struct solo1_state *s = pci_get_drvdata(dev);
...@@ -2447,7 +2447,7 @@ static struct pci_driver solo1_driver = { ...@@ -2447,7 +2447,7 @@ static struct pci_driver solo1_driver = {
.name = "ESS Solo1", .name = "ESS Solo1",
.id_table = id_table, .id_table = id_table,
.probe = solo1_probe, .probe = solo1_probe,
.remove = solo1_remove, .remove = __devexit_p(solo1_remove),
.suspend = solo1_suspend, .suspend = solo1_suspend,
.resume = solo1_resume, .resume = solo1_resume,
}; };
......
...@@ -2165,7 +2165,7 @@ static int __devinit it8172_probe(struct pci_dev *pcidev, ...@@ -2165,7 +2165,7 @@ static int __devinit it8172_probe(struct pci_dev *pcidev,
return -1; 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); struct it8172_state *s = pci_get_drvdata(dev);
...@@ -2200,7 +2200,7 @@ static struct pci_driver it8172_driver = { ...@@ -2200,7 +2200,7 @@ static struct pci_driver it8172_driver = {
.name = IT8172_MODULE_NAME, .name = IT8172_MODULE_NAME,
.id_table = id_table, .id_table = id_table,
.probe = it8172_probe, .probe = it8172_probe,
.remove = it8172_remove .remove = __devexit_p(it8172_remove)
}; };
static int __init init_it8172(void) static int __init init_it8172(void)
......
...@@ -1964,7 +1964,7 @@ static int __devinit vrc5477_ac97_probe(struct pci_dev *pcidev, ...@@ -1964,7 +1964,7 @@ static int __devinit vrc5477_ac97_probe(struct pci_dev *pcidev,
return -1; 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); struct vrc5477_ac97_state *s = pci_get_drvdata(dev);
...@@ -2000,7 +2000,7 @@ static struct pci_driver vrc5477_ac97_driver = { ...@@ -2000,7 +2000,7 @@ static struct pci_driver vrc5477_ac97_driver = {
.name = VRC5477_AC97_MODULE_NAME, .name = VRC5477_AC97_MODULE_NAME,
.id_table = id_table, .id_table = id_table,
.probe = vrc5477_ac97_probe, .probe = vrc5477_ac97_probe,
.remove = vrc5477_ac97_remove, .remove = __devexit_p(vrc5477_ac97_remove),
}; };
static int __init init_vrc5477_ac97(void) static int __init init_vrc5477_ac97(void)
......
...@@ -1033,7 +1033,7 @@ static int __devinit rme96xx_probe(struct pci_dev *pcidev, const struct pci_devi ...@@ -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; int i;
rme96xx_info *s = pci_get_drvdata(dev); rme96xx_info *s = pci_get_drvdata(dev);
...@@ -1087,7 +1087,7 @@ static struct pci_driver rme96xx_driver = { ...@@ -1087,7 +1087,7 @@ static struct pci_driver rme96xx_driver = {
.name = "rme96xx", .name = "rme96xx",
.id_table = id_table, .id_table = id_table,
.probe = rme96xx_probe, .probe = rme96xx_probe,
.remove = rme96xx_remove, .remove = __devexit_p(rme96xx_remove),
}; };
static int __init init_rme96xx(void) static int __init init_rme96xx(void)
......
...@@ -2678,7 +2678,7 @@ static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id ...@@ -2678,7 +2678,7 @@ static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id
return ret; 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); struct sv_state *s = pci_get_drvdata(dev);
...@@ -2720,7 +2720,7 @@ static struct pci_driver sv_driver = { ...@@ -2720,7 +2720,7 @@ static struct pci_driver sv_driver = {
.name = "sonicvibes", .name = "sonicvibes",
.id_table = id_table, .id_table = id_table,
.probe = sv_probe, .probe = sv_probe,
.remove = sv_remove, .remove = __devexit_p(sv_remove),
}; };
static int __init init_sonicvibes(void) static int __init init_sonicvibes(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment