Commit 7fd37c97 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

PCI: fix up probe functions for OSS drivers

  
Can not be marked __init, must be marked __devinit or not at all.
If it is marked __init, then oops can happen by a user writing to the
"new_id" file from sysfs.
parent 98cc783f
...@@ -3228,7 +3228,7 @@ static int ali_ac97_random_init_stuff(struct ali_card ...@@ -3228,7 +3228,7 @@ static int ali_ac97_random_init_stuff(struct ali_card
/* AC97 codec initialisation. */ /* AC97 codec initialisation. */
static int __init ali_ac97_init(struct ali_card *card) static int __devinit ali_ac97_init(struct ali_card *card)
{ {
int num_ac97 = 0; int num_ac97 = 0;
int total_channels = 0; int total_channels = 0;
...@@ -3333,7 +3333,7 @@ static int __init ali_ac97_init(struct ali_card *card) ...@@ -3333,7 +3333,7 @@ static int __init ali_ac97_init(struct ali_card *card)
return num_ac97; return num_ac97;
} }
static void __init ali_configure_clocking(void) static void __devinit ali_configure_clocking(void)
{ {
struct ali_card *card; struct ali_card *card;
struct ali_state *state; struct ali_state *state;
...@@ -3403,8 +3403,8 @@ static void __init ali_configure_clocking(void) ...@@ -3403,8 +3403,8 @@ static void __init ali_configure_clocking(void)
/* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered /* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered
until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */ until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */
static int __init ali_probe(struct pci_dev *pci_dev, const struct pci_device_id static int __devinit ali_probe(struct pci_dev *pci_dev,
*pci_id) const struct pci_device_id *pci_id)
{ {
struct ali_card *card; struct ali_card *card;
if (pci_enable_device(pci_dev)) if (pci_enable_device(pci_dev))
......
...@@ -2807,7 +2807,7 @@ static int i810_ac97_power_up_bus(struct i810_card *card) ...@@ -2807,7 +2807,7 @@ static int i810_ac97_power_up_bus(struct i810_card *card)
return 1; return 1;
} }
static int __init i810_ac97_init(struct i810_card *card) static int __devinit i810_ac97_init(struct i810_card *card)
{ {
int num_ac97 = 0; int num_ac97 = 0;
int ac97_id; int ac97_id;
...@@ -3011,7 +3011,7 @@ static int __init i810_ac97_init(struct i810_card *card) ...@@ -3011,7 +3011,7 @@ static int __init i810_ac97_init(struct i810_card *card)
return num_ac97; return num_ac97;
} }
static void __init i810_configure_clocking (void) static void __devinit i810_configure_clocking (void)
{ {
struct i810_card *card; struct i810_card *card;
struct i810_state *state; struct i810_state *state;
...@@ -3083,7 +3083,7 @@ static void __init i810_configure_clocking (void) ...@@ -3083,7 +3083,7 @@ static void __init i810_configure_clocking (void)
/* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered /* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered
until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */ until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */
static int __init i810_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
{ {
struct i810_card *card; struct i810_card *card;
......
...@@ -2297,7 +2297,7 @@ static void m3_codec_reset(struct m3_card *card, int busywait) ...@@ -2297,7 +2297,7 @@ static void m3_codec_reset(struct m3_card *card, int busywait)
#endif #endif
} }
static int __init m3_codec_install(struct m3_card *card) static int __devinit m3_codec_install(struct m3_card *card)
{ {
struct ac97_codec *codec; struct ac97_codec *codec;
...@@ -2594,7 +2594,7 @@ void free_dsp_suspendmem(struct m3_card *card) ...@@ -2594,7 +2594,7 @@ void free_dsp_suspendmem(struct m3_card *card)
/* /*
* great day! this function is ugly as hell. * great day! this function is ugly as hell.
*/ */
static int __init m3_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) static int __devinit m3_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
{ {
u32 n; u32 n;
int i; int i;
......
...@@ -3957,7 +3957,7 @@ static int ali_reset_5451(struct trident_card *card) ...@@ -3957,7 +3957,7 @@ static int ali_reset_5451(struct trident_card *card)
} }
/* AC97 codec initialisation. */ /* AC97 codec initialisation. */
static int __init trident_ac97_init(struct trident_card *card) static int __devinit trident_ac97_init(struct trident_card *card)
{ {
int num_ac97 = 0; int num_ac97 = 0;
unsigned long ready_2nd = 0; unsigned long ready_2nd = 0;
...@@ -4120,7 +4120,7 @@ static int trident_game_open(struct gameport *gameport, int mode) ...@@ -4120,7 +4120,7 @@ static int trident_game_open(struct gameport *gameport, int mode)
/* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered /* install the driver, we do not allocate hardware channel nor DMA buffer now, they are defered
until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */ until "ACCESS" time (in prog_dmabuf called by open/read/write/ioctl/mmap) */
static int __init trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id) static int __devinit trident_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id)
{ {
unsigned long iobase; unsigned long iobase;
struct trident_card *card; struct trident_card *card;
......
...@@ -1642,7 +1642,7 @@ static struct file_operations via_mixer_fops = { ...@@ -1642,7 +1642,7 @@ static struct file_operations via_mixer_fops = {
}; };
static int __init via_ac97_reset (struct via_info *card) static int __devinit via_ac97_reset (struct via_info *card)
{ {
struct pci_dev *pdev = card->pdev; struct pci_dev *pdev = card->pdev;
u8 tmp8; u8 tmp8;
...@@ -1752,7 +1752,7 @@ static void via_ac97_codec_wait (struct ac97_codec *codec) ...@@ -1752,7 +1752,7 @@ static void via_ac97_codec_wait (struct ac97_codec *codec)
} }
static int __init via_ac97_init (struct via_info *card) static int __devinit via_ac97_init (struct via_info *card)
{ {
int rc; int rc;
u16 tmp16; u16 tmp16;
...@@ -2070,7 +2070,7 @@ static struct file_operations via_dsp_fops = { ...@@ -2070,7 +2070,7 @@ static struct file_operations via_dsp_fops = {
}; };
static int __init via_dsp_init (struct via_info *card) static int __devinit via_dsp_init (struct via_info *card)
{ {
u8 tmp8; u8 tmp8;
...@@ -3394,7 +3394,7 @@ static int via_dsp_release(struct inode *inode, struct file *file) ...@@ -3394,7 +3394,7 @@ static int via_dsp_release(struct inode *inode, struct file *file)
* *
*/ */
static int __init via_init_one (struct pci_dev *pdev, const struct pci_device_id *id) static int __devinit via_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
{ {
#ifdef CONFIG_MIDI_VIA82CXXX #ifdef CONFIG_MIDI_VIA82CXXX
u8 r42; u8 r42;
...@@ -3772,7 +3772,7 @@ static void via_cleanup_proc (void) ...@@ -3772,7 +3772,7 @@ static void via_cleanup_proc (void)
} }
static int __init via_card_init_proc (struct via_info *card) static int __devinit via_card_init_proc (struct via_info *card)
{ {
char s[32]; char s[32];
int rc; int rc;
......
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