* [BK PATCH] PCI fixes for 2.6.0-test7
@ 2003-10-15 18:23 Greg KH
2003-10-15 18:24 ` [PATCH] " Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-10-15 18:23 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
Hi,
Here are some PCI fixes for 2.6.0-test7. They fix up a lot of pci
drivers that mistakenly mark their probe function with "__init". This
causes oopses if CONFIG_HOTPLUG is enabled and users write to the
"new_id" sysfs file. I've also cleaned up some MOD_INC and MOD_DEC
compiler warnings that were present in some OSS and other char drivers.
Please pull from:
bk://kernel.bkbits.net/gregkh/linux/pci-2.6
thanks,
greg k-h
p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.
drivers/char/agp/ali-agp.c | 4 ++--
drivers/char/agp/amd-k7-agp.c | 6 +++---
drivers/char/agp/amd64-agp.c | 10 +++++-----
drivers/char/agp/ati-agp.c | 6 +++---
drivers/char/agp/i460-agp.c | 4 ++--
drivers/char/agp/intel-agp.c | 4 ++--
drivers/char/agp/nvidia-agp.c | 4 ++--
drivers/char/agp/sis-agp.c | 6 +++---
drivers/char/agp/sworks-agp.c | 4 ++--
drivers/char/agp/uninorth-agp.c | 6 +++---
drivers/char/agp/via-agp.c | 6 +++---
drivers/char/ite_gpio.c | 9 ---------
drivers/char/synclink.c | 4 ++--
drivers/char/synclinkmp.c | 4 ++--
sound/oss/ad1889.c | 6 ++----
sound/oss/ali5455.c | 8 ++++----
sound/oss/cs4281/cs4281m.c | 11 +++--------
sound/oss/cs46xx.c | 6 ------
sound/oss/i810_audio.c | 6 +++---
sound/oss/maestro3.c | 4 ++--
sound/oss/swarm_cs4297a.c | 8 ++------
sound/oss/trident.c | 4 ++--
sound/oss/via82cxxx_audio.c | 10 +++++-----
23 files changed, 57 insertions(+), 83 deletions(-)
-----
Greg Kroah-Hartman:
o OSS: fix up MOD_INC and MOD_DEC usages to remove compiler warnings
o CHAR: Remove unneeded MOD_INC and MOD_DEC calls
o PCI: fix up probe functions for OSS drivers
o PCI: fix up probe functions for synclink drivers
o PCI: fix up probe functions for agp drivers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test7
2003-10-15 18:24 ` [PATCH] " Greg KH
@ 2003-10-15 18:24 ` Greg KH
2003-10-15 18:24 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-10-15 18:24 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1347.1.2, 2003/10/13 11:06:38-07:00, greg@kroah.com
PCI: fix up probe functions for synclink 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.
drivers/char/synclink.c | 4 ++--
drivers/char/synclinkmp.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c
--- a/drivers/char/synclink.c Wed Oct 15 11:18:47 2003
+++ b/drivers/char/synclink.c Wed Oct 15 11:18:47 2003
@@ -8020,8 +8020,8 @@
#endif /* ifdef CONFIG_SYNCLINK_SYNCPPP */
-static int __init synclink_init_one (struct pci_dev *dev,
- const struct pci_device_id *ent)
+static int __devinit synclink_init_one (struct pci_dev *dev,
+ const struct pci_device_id *ent)
{
struct mgsl_struct *info;
diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
--- a/drivers/char/synclinkmp.c Wed Oct 15 11:18:47 2003
+++ b/drivers/char/synclinkmp.c Wed Oct 15 11:18:47 2003
@@ -5451,8 +5451,8 @@
}
-static int __init synclinkmp_init_one (struct pci_dev *dev,
- const struct pci_device_id *ent)
+static int __devinit synclinkmp_init_one (struct pci_dev *dev,
+ const struct pci_device_id *ent)
{
if (pci_enable_device(dev)) {
printk("error enabling pci device %p\n", dev);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] PCI fixes for 2.6.0-test7
2003-10-15 18:23 [BK PATCH] PCI fixes for 2.6.0-test7 Greg KH
@ 2003-10-15 18:24 ` Greg KH
2003-10-15 18:24 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-10-15 18:24 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1347.1.1, 2003/10/13 11:05:52-07:00, greg@kroah.com
PCI: fix up probe functions for agp 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.
drivers/char/agp/ali-agp.c | 4 ++--
drivers/char/agp/amd-k7-agp.c | 6 +++---
drivers/char/agp/amd64-agp.c | 10 +++++-----
drivers/char/agp/ati-agp.c | 6 +++---
drivers/char/agp/i460-agp.c | 4 ++--
drivers/char/agp/intel-agp.c | 4 ++--
drivers/char/agp/nvidia-agp.c | 4 ++--
drivers/char/agp/sis-agp.c | 6 +++---
drivers/char/agp/sworks-agp.c | 4 ++--
drivers/char/agp/uninorth-agp.c | 6 +++---
drivers/char/agp/via-agp.c | 6 +++---
11 files changed, 30 insertions(+), 30 deletions(-)
diff -Nru a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c
--- a/drivers/char/agp/ali-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/ali-agp.c Wed Oct 15 11:18:51 2003
@@ -231,7 +231,7 @@
};
-static struct agp_device_ids ali_agp_device_ids[] __initdata =
+static struct agp_device_ids ali_agp_device_ids[] __devinitdata =
{
{
.device_id = PCI_DEVICE_ID_AL_M1541,
@@ -272,7 +272,7 @@
{ }, /* dummy final entry, always present */
};
-static int __init agp_ali_probe(struct pci_dev *pdev,
+static int __devinit agp_ali_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
struct agp_device_ids *devs = ali_agp_device_ids;
diff -Nru a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c
--- a/drivers/char/agp/amd-k7-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/amd-k7-agp.c Wed Oct 15 11:18:51 2003
@@ -365,7 +365,7 @@
.agp_destroy_page = agp_generic_destroy_page,
};
-static struct agp_device_ids amd_agp_device_ids[] __initdata =
+static struct agp_device_ids amd_agp_device_ids[] __devinitdata =
{
{
.device_id = PCI_DEVICE_ID_AMD_FE_GATE_7006,
@@ -382,8 +382,8 @@
{ }, /* dummy final entry, always present */
};
-static int __init agp_amdk7_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_device_ids *devs = amd_agp_device_ids;
struct agp_bridge_data *bridge;
diff -Nru a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
--- a/drivers/char/agp/amd64-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/amd64-agp.c Wed Oct 15 11:18:51 2003
@@ -248,7 +248,7 @@
};
/* Some basic sanity checks for the aperture. */
-static int __init aperture_valid(u64 aper, u32 size)
+static int __devinit aperture_valid(u64 aper, u32 size)
{
static int not_first_call;
u32 pfn, c;
@@ -297,7 +297,7 @@
* to allocate that much memory. But at least error out cleanly instead of
* crashing.
*/
-static __init int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
+static __devinit int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
u16 cap)
{
u32 aper_low, aper_hi;
@@ -339,7 +339,7 @@
return 0;
}
-static __init int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
+static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
{
struct pci_dev *loop_dev = NULL;
int i = 0;
@@ -365,8 +365,8 @@
return i == 0 ? -1 : 0;
}
-static int __init agp_amd64_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_amd64_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_bridge_data *bridge;
u8 rev_id;
diff -Nru a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
--- a/drivers/char/agp/ati-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/ati-agp.c Wed Oct 15 11:18:51 2003
@@ -403,7 +403,7 @@
};
-static struct agp_device_ids ati_agp_device_ids[] __initdata =
+static struct agp_device_ids ati_agp_device_ids[] __devinitdata =
{
{
.device_id = PCI_DEVICE_ID_ATI_RS100,
@@ -436,8 +436,8 @@
{ }, /* dummy final entry, always present */
};
-static int __init agp_ati_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_ati_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_device_ids *devs = ati_agp_device_ids;
struct agp_bridge_data *bridge;
diff -Nru a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c
--- a/drivers/char/agp/i460-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/i460-agp.c Wed Oct 15 11:18:51 2003
@@ -560,8 +560,8 @@
.cant_use_aperture = 1,
};
-static int __init agp_intel_i460_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_intel_i460_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_bridge_data *bridge;
u8 cap_ptr;
diff -Nru a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
--- a/drivers/char/agp/intel-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/intel-agp.c Wed Oct 15 11:18:51 2003
@@ -1232,8 +1232,8 @@
return 1;
}
-static int __init agp_intel_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_intel_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_bridge_data *bridge;
char *name = "(unknown)";
diff -Nru a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
--- a/drivers/char/agp/nvidia-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/nvidia-agp.c Wed Oct 15 11:18:51 2003
@@ -250,8 +250,8 @@
.agp_destroy_page = agp_generic_destroy_page,
};
-static int __init agp_nvidia_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_nvidia_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_bridge_data *bridge;
u8 cap_ptr;
diff -Nru a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
--- a/drivers/char/agp/sis-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/sis-agp.c Wed Oct 15 11:18:51 2003
@@ -95,7 +95,7 @@
.agp_destroy_page = agp_generic_destroy_page,
};
-static struct agp_device_ids sis_agp_device_ids[] __initdata =
+static struct agp_device_ids sis_agp_device_ids[] __devinitdata =
{
{
.device_id = PCI_DEVICE_ID_SI_530,
@@ -164,8 +164,8 @@
{ }, /* dummy final entry, always present */
};
-static int __init agp_sis_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_sis_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_device_ids *devs = sis_agp_device_ids;
struct agp_bridge_data *bridge;
diff -Nru a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
--- a/drivers/char/agp/sworks-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/sworks-agp.c Wed Oct 15 11:18:51 2003
@@ -437,8 +437,8 @@
.agp_destroy_page = agp_generic_destroy_page,
};
-static int __init agp_serverworks_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_bridge_data *bridge;
struct pci_dev *bridge_dev;
diff -Nru a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
--- a/drivers/char/agp/uninorth-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/uninorth-agp.c Wed Oct 15 11:18:51 2003
@@ -282,7 +282,7 @@
.cant_use_aperture = 1,
};
-static struct agp_device_ids uninorth_agp_device_ids[] __initdata = {
+static struct agp_device_ids uninorth_agp_device_ids[] __devinitdata = {
{
.device_id = PCI_DEVICE_ID_APPLE_UNI_N_AGP,
.chipset_name = "UniNorth",
@@ -301,8 +301,8 @@
},
};
-static int __init agp_uninorth_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_device_ids *devs = uninorth_agp_device_ids;
struct agp_bridge_data *bridge;
diff -Nru a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
--- a/drivers/char/agp/via-agp.c Wed Oct 15 11:18:51 2003
+++ b/drivers/char/agp/via-agp.c Wed Oct 15 11:18:51 2003
@@ -211,7 +211,7 @@
.agp_destroy_page = agp_generic_destroy_page,
};
-static struct agp_device_ids via_agp_device_ids[] __initdata =
+static struct agp_device_ids via_agp_device_ids[] __devinitdata =
{
{
.device_id = PCI_DEVICE_ID_VIA_82C597_0,
@@ -371,8 +371,8 @@
}
-static int __init agp_via_probe(struct pci_dev *pdev,
- const struct pci_device_id *ent)
+static int __devinit agp_via_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
struct agp_device_ids *devs = via_agp_device_ids;
struct agp_bridge_data *bridge;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test7
2003-10-15 18:24 ` Greg KH
@ 2003-10-15 18:24 ` Greg KH
2003-10-15 18:24 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-10-15 18:24 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1347.1.3, 2003/10/13 11:07:23-07:00, greg@kroah.com
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.
sound/oss/ali5455.c | 8 ++++----
sound/oss/i810_audio.c | 6 +++---
sound/oss/maestro3.c | 4 ++--
sound/oss/trident.c | 4 ++--
sound/oss/via82cxxx_audio.c | 10 +++++-----
5 files changed, 16 insertions(+), 16 deletions(-)
diff -Nru a/sound/oss/ali5455.c b/sound/oss/ali5455.c
--- a/sound/oss/ali5455.c Wed Oct 15 11:18:41 2003
+++ b/sound/oss/ali5455.c Wed Oct 15 11:18:41 2003
@@ -3228,7 +3228,7 @@
/* 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 total_channels = 0;
@@ -3333,7 +3333,7 @@
return num_ac97;
}
-static void __init ali_configure_clocking(void)
+static void __devinit ali_configure_clocking(void)
{
struct ali_card *card;
struct ali_state *state;
@@ -3403,8 +3403,8 @@
/* 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) */
-static int __init ali_probe(struct pci_dev *pci_dev, const struct pci_device_id
- *pci_id)
+static int __devinit ali_probe(struct pci_dev *pci_dev,
+ const struct pci_device_id *pci_id)
{
struct ali_card *card;
if (pci_enable_device(pci_dev))
diff -Nru a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
--- a/sound/oss/i810_audio.c Wed Oct 15 11:18:41 2003
+++ b/sound/oss/i810_audio.c Wed Oct 15 11:18:41 2003
@@ -2807,7 +2807,7 @@
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 ac97_id;
@@ -3011,7 +3011,7 @@
return num_ac97;
}
-static void __init i810_configure_clocking (void)
+static void __devinit i810_configure_clocking (void)
{
struct i810_card *card;
struct i810_state *state;
@@ -3083,7 +3083,7 @@
/* 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) */
-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;
diff -Nru a/sound/oss/maestro3.c b/sound/oss/maestro3.c
--- a/sound/oss/maestro3.c Wed Oct 15 11:18:41 2003
+++ b/sound/oss/maestro3.c Wed Oct 15 11:18:41 2003
@@ -2297,7 +2297,7 @@
#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;
@@ -2594,7 +2594,7 @@
/*
* 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;
int i;
diff -Nru a/sound/oss/trident.c b/sound/oss/trident.c
--- a/sound/oss/trident.c Wed Oct 15 11:18:41 2003
+++ b/sound/oss/trident.c Wed Oct 15 11:18:41 2003
@@ -3957,7 +3957,7 @@
}
/* 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;
unsigned long ready_2nd = 0;
@@ -4120,7 +4120,7 @@
/* 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) */
-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;
struct trident_card *card;
diff -Nru a/sound/oss/via82cxxx_audio.c b/sound/oss/via82cxxx_audio.c
--- a/sound/oss/via82cxxx_audio.c Wed Oct 15 11:18:41 2003
+++ b/sound/oss/via82cxxx_audio.c Wed Oct 15 11:18:41 2003
@@ -1642,7 +1642,7 @@
};
-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;
u8 tmp8;
@@ -1752,7 +1752,7 @@
}
-static int __init via_ac97_init (struct via_info *card)
+static int __devinit via_ac97_init (struct via_info *card)
{
int rc;
u16 tmp16;
@@ -2070,7 +2070,7 @@
};
-static int __init via_dsp_init (struct via_info *card)
+static int __devinit via_dsp_init (struct via_info *card)
{
u8 tmp8;
@@ -3394,7 +3394,7 @@
*
*/
-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
u8 r42;
@@ -3772,7 +3772,7 @@
}
-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];
int rc;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test7
2003-10-15 18:24 ` Greg KH
@ 2003-10-15 18:24 ` Greg KH
2003-10-15 18:24 ` Greg KH
0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2003-10-15 18:24 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1347.1.4, 2003/10/13 11:32:38-07:00, greg@kroah.com
CHAR: Remove unneeded MOD_INC and MOD_DEC calls.
drivers/char/ite_gpio.c | 9 ---------
1 files changed, 9 deletions(-)
diff -Nru a/drivers/char/ite_gpio.c b/drivers/char/ite_gpio.c
--- a/drivers/char/ite_gpio.c Wed Oct 15 11:18:36 2003
+++ b/drivers/char/ite_gpio.c Wed Oct 15 11:18:36 2003
@@ -242,21 +242,12 @@
if (minor != GPIO_MINOR)
return -ENODEV;
-#ifdef MODULE
- MOD_INC_USE_COUNT;
-#endif
-
return 0;
}
static int ite_gpio_release(struct inode *inode, struct file *file)
{
-
-#ifdef MODULE
- MOD_DEC_USE_COUNT;
-#endif
-
return 0;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI fixes for 2.6.0-test7
2003-10-15 18:24 ` Greg KH
@ 2003-10-15 18:24 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2003-10-15 18:24 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1347.1.5, 2003/10/13 11:42:19-07:00, greg@kroah.com
OSS: fix up MOD_INC and MOD_DEC usages to remove compiler warnings.
sound/oss/ad1889.c | 6 ++----
sound/oss/cs4281/cs4281m.c | 11 +++--------
sound/oss/cs46xx.c | 6 ------
sound/oss/swarm_cs4297a.c | 8 ++------
4 files changed, 7 insertions(+), 24 deletions(-)
diff -Nru a/sound/oss/ad1889.c b/sound/oss/ad1889.c
--- a/sound/oss/ad1889.c Wed Oct 15 11:18:31 2003
+++ b/sound/oss/ad1889.c Wed Oct 15 11:18:31 2003
@@ -763,18 +763,17 @@
ad1889_set_wav_rate(ad1889_dev, 44100);
ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE);
AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */
- MOD_INC_USE_COUNT;
return 0;
}
static int ad1889_release(struct inode *inode, struct file *file)
{
/* if we have state free it here */
- MOD_DEC_USE_COUNT;
return 0;
}
static struct file_operations ad1889_fops = {
+ .owner = THIS_MODULE,
.llseek = no_llseek,
.read = ad1889_read,
.write = ad1889_write,
@@ -792,13 +791,11 @@
return -ENODEV;
file->private_data = ad1889_dev->ac97_codec;
- MOD_INC_USE_COUNT;
return 0;
}
static int ad1889_mixer_release(struct inode *inode, struct file *file)
{
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -810,6 +807,7 @@
}
static struct file_operations ad1889_mixer_fops = {
+ .owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = ad1889_mixer_ioctl,
.open = ad1889_mixer_open,
diff -Nru a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
--- a/sound/oss/cs4281/cs4281m.c Wed Oct 15 11:18:31 2003
+++ b/sound/oss/cs4281/cs4281m.c Wed Oct 15 11:18:31 2003
@@ -2588,7 +2588,6 @@
}
VALIDATE_STATE(s);
file->private_data = s;
- MOD_INC_USE_COUNT;
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs4281: cs4281_open_mixdev()- 0\n"));
@@ -2603,7 +2602,6 @@
(struct cs4281_state *) file->private_data;
VALIDATE_STATE(s);
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -2620,6 +2618,7 @@
// Mixer file operations struct.
// ******************************************************************************************
static /*const */ struct file_operations cs4281_mixer_fops = {
+ .owner = THIS_MODULE,
.llseek = no_llseek,
.ioctl = cs4281_ioctl_mixdev,
.open = cs4281_open_mixdev,
@@ -3607,7 +3606,6 @@
s->open_mode &= ~FMODE_WRITE;
up(&s->open_sem_dac);
wake_up(&s->open_wait_dac);
- MOD_DEC_USE_COUNT;
}
if (file->f_mode & FMODE_READ) {
drain_adc(s, file->f_flags & O_NONBLOCK);
@@ -3617,7 +3615,6 @@
s->open_mode &= ~FMODE_READ;
up(&s->open_sem_adc);
wake_up(&s->open_wait_adc);
- MOD_DEC_USE_COUNT;
}
return 0;
}
@@ -3697,7 +3694,6 @@
s->dma_adc.ossfragshift = s->dma_adc.ossmaxfrags =
s->dma_adc.subdivision = 0;
up(&s->open_sem_adc);
- MOD_INC_USE_COUNT;
if (prog_dmabuf_adc(s)) {
CS_DBGOUT(CS_OPEN | CS_ERROR, 2, printk(KERN_ERR
@@ -3718,7 +3714,6 @@
s->dma_dac.ossfragshift = s->dma_dac.ossmaxfrags =
s->dma_dac.subdivision = 0;
up(&s->open_sem_dac);
- MOD_INC_USE_COUNT;
if (prog_dmabuf_dac(s)) {
CS_DBGOUT(CS_OPEN | CS_ERROR, 2, printk(KERN_ERR
@@ -3738,6 +3733,7 @@
// Wave (audio) file operations struct.
// ******************************************************************************************
static /*const */ struct file_operations cs4281_audio_fops = {
+ .owner = THIS_MODULE,
.llseek = no_llseek,
.read = cs4281_read,
.write = cs4281_write,
@@ -4029,7 +4025,6 @@
f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ |
FMODE_MIDI_WRITE);
up(&s->open_sem);
- MOD_INC_USE_COUNT;
return 0;
}
@@ -4080,7 +4075,6 @@
spin_unlock_irqrestore(&s->lock, flags);
up(&s->open_sem);
wake_up(&s->open_wait);
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -4088,6 +4082,7 @@
// Midi file operations struct.
// ******************************************************************************************
static /*const */ struct file_operations cs4281_midi_fops = {
+ .owner = THIS_MODULE,
.llseek = no_llseek,
.read = cs4281_midi_read,
.write = cs4281_midi_write,
diff -Nru a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
--- a/sound/oss/cs46xx.c Wed Oct 15 11:18:31 2003
+++ b/sound/oss/cs46xx.c Wed Oct 15 11:18:31 2003
@@ -1890,7 +1890,6 @@
spin_unlock_irqrestore(&card->midi.lock, flags);
card->midi.open_mode |= (file->f_mode & (FMODE_READ | FMODE_WRITE));
up(&card->midi.open_sem);
- MOD_INC_USE_COUNT; /* for 2.2 */
return 0;
}
@@ -1926,7 +1925,6 @@
card->midi.open_mode &= (~(file->f_mode & (FMODE_READ | FMODE_WRITE)));
up(&card->midi.open_sem);
wake_up(&card->midi.open_wait);
- MOD_DEC_USE_COUNT; /* for 2.2 */
return 0;
}
@@ -3370,7 +3368,6 @@
if((ret = prog_dmabuf(state)))
return ret;
}
- MOD_INC_USE_COUNT; /* for 2.2 */
CS_DBGOUT(CS_OPEN | CS_FUNCTION, 2, printk("cs46xx: cs_open()- 0\n") );
return 0;
}
@@ -3457,7 +3454,6 @@
}
CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 2, printk("cs46xx: cs_release()- 0\n") );
- MOD_DEC_USE_COUNT; /* For 2.2 */
return 0;
}
@@ -4105,7 +4101,6 @@
}
card->amplifier_ctrl(card, 1);
CS_INC_USE_COUNT(&card->mixer_use_cnt);
- MOD_INC_USE_COUNT; /* for 2.2 */
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs46xx: cs_open_mixdev()- 0\n"));
return 0;
@@ -4136,7 +4131,6 @@
return -ENODEV;
}
match:
- MOD_DEC_USE_COUNT; /* for 2.2 */
if(!CS_DEC_AND_TEST(&card->mixer_use_cnt))
{
CS_DBGOUT(CS_FUNCTION | CS_RELEASE, 4,
diff -Nru a/sound/oss/swarm_cs4297a.c b/sound/oss/swarm_cs4297a.c
--- a/sound/oss/swarm_cs4297a.c Wed Oct 15 11:18:31 2003
+++ b/sound/oss/swarm_cs4297a.c Wed Oct 15 11:18:31 2003
@@ -1557,7 +1557,6 @@
}
VALIDATE_STATE(s);
file->private_data = s;
- MOD_INC_USE_COUNT;
CS_DBGOUT(CS_FUNCTION | CS_OPEN, 4,
printk(KERN_INFO "cs4297a: cs4297a_open_mixdev()- 0\n"));
@@ -1572,7 +1571,6 @@
(struct cs4297a_state *) file->private_data;
VALIDATE_STATE(s);
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -1589,6 +1587,7 @@
// Mixer file operations struct.
// ******************************************************************************************
static /*const */ struct file_operations cs4297a_mixer_fops = {
+ .owner = THIS_MODULE,
.llseek = cs4297a_llseek,
.ioctl = cs4297a_ioctl_mixdev,
.open = cs4297a_open_mixdev,
@@ -2368,7 +2367,6 @@
s->open_mode &= ~FMODE_WRITE;
up(&s->open_sem_dac);
wake_up(&s->open_wait_dac);
- MOD_DEC_USE_COUNT;
}
if (file->f_mode & FMODE_READ) {
drain_adc(s, file->f_flags & O_NONBLOCK);
@@ -2378,7 +2376,6 @@
s->open_mode &= ~FMODE_READ;
up(&s->open_sem_adc);
wake_up(&s->open_wait_adc);
- MOD_DEC_USE_COUNT;
}
return 0;
}
@@ -2469,7 +2466,6 @@
s->dma_adc.ossfragshift = s->dma_adc.ossmaxfrags =
s->dma_adc.subdivision = 0;
up(&s->open_sem_adc);
- MOD_INC_USE_COUNT;
if (prog_dmabuf_adc(s)) {
CS_DBGOUT(CS_OPEN | CS_ERROR, 2, printk(KERN_ERR
@@ -2488,7 +2484,6 @@
s->dma_dac.ossfragshift = s->dma_dac.ossmaxfrags =
s->dma_dac.subdivision = 0;
up(&s->open_sem_dac);
- MOD_INC_USE_COUNT;
if (prog_dmabuf_dac(s)) {
CS_DBGOUT(CS_OPEN | CS_ERROR, 2, printk(KERN_ERR
@@ -2507,6 +2502,7 @@
// Wave (audio) file operations struct.
// ******************************************************************************************
static /*const */ struct file_operations cs4297a_audio_fops = {
+ .owner = THIS_MODULE,
.llseek = cs4297a_llseek,
.read = cs4297a_read,
.write = cs4297a_write,
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-10-15 18:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-15 18:23 [BK PATCH] PCI fixes for 2.6.0-test7 Greg KH
2003-10-15 18:24 ` [PATCH] " Greg KH
2003-10-15 18:24 ` Greg KH
2003-10-15 18:24 ` Greg KH
2003-10-15 18:24 ` Greg KH
2003-10-15 18:24 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.