Commit d93bc786 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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.
parent 6ab5c9ad
...@@ -231,7 +231,7 @@ struct agp_bridge_driver ali_m1541_bridge = { ...@@ -231,7 +231,7 @@ struct agp_bridge_driver ali_m1541_bridge = {
}; };
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, .device_id = PCI_DEVICE_ID_AL_M1541,
...@@ -272,7 +272,7 @@ static struct agp_device_ids ali_agp_device_ids[] __initdata = ...@@ -272,7 +272,7 @@ static struct agp_device_ids ali_agp_device_ids[] __initdata =
{ }, /* dummy final entry, always present */ { }, /* 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) const struct pci_device_id *ent)
{ {
struct agp_device_ids *devs = ali_agp_device_ids; struct agp_device_ids *devs = ali_agp_device_ids;
......
...@@ -365,7 +365,7 @@ struct agp_bridge_driver amd_irongate_driver = { ...@@ -365,7 +365,7 @@ struct agp_bridge_driver amd_irongate_driver = {
.agp_destroy_page = agp_generic_destroy_page, .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, .device_id = PCI_DEVICE_ID_AMD_FE_GATE_7006,
...@@ -382,8 +382,8 @@ static struct agp_device_ids amd_agp_device_ids[] __initdata = ...@@ -382,8 +382,8 @@ static struct agp_device_ids amd_agp_device_ids[] __initdata =
{ }, /* dummy final entry, always present */ { }, /* dummy final entry, always present */
}; };
static int __init agp_amdk7_probe(struct pci_dev *pdev, static int __devinit agp_amdk7_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_device_ids *devs = amd_agp_device_ids; struct agp_device_ids *devs = amd_agp_device_ids;
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
......
...@@ -248,7 +248,7 @@ struct agp_bridge_driver amd_8151_driver = { ...@@ -248,7 +248,7 @@ struct agp_bridge_driver amd_8151_driver = {
}; };
/* Some basic sanity checks for the aperture. */ /* 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; static int not_first_call;
u32 pfn, c; u32 pfn, c;
...@@ -297,7 +297,7 @@ static int __init aperture_valid(u64 aper, u32 size) ...@@ -297,7 +297,7 @@ static int __init aperture_valid(u64 aper, u32 size)
* to allocate that much memory. But at least error out cleanly instead of * to allocate that much memory. But at least error out cleanly instead of
* crashing. * 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) u16 cap)
{ {
u32 aper_low, aper_hi; u32 aper_low, aper_hi;
...@@ -339,7 +339,7 @@ static __init int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp, ...@@ -339,7 +339,7 @@ static __init int fix_northbridge(struct pci_dev *nb, struct pci_dev *agp,
return 0; 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; struct pci_dev *loop_dev = NULL;
int i = 0; int i = 0;
...@@ -365,8 +365,8 @@ static __init int cache_nbs (struct pci_dev *pdev, u32 cap_ptr) ...@@ -365,8 +365,8 @@ static __init int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
return i == 0 ? -1 : 0; return i == 0 ? -1 : 0;
} }
static int __init agp_amd64_probe(struct pci_dev *pdev, static int __devinit agp_amd64_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
u8 rev_id; u8 rev_id;
......
...@@ -403,7 +403,7 @@ struct agp_bridge_driver ati_generic_bridge = { ...@@ -403,7 +403,7 @@ struct agp_bridge_driver ati_generic_bridge = {
}; };
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, .device_id = PCI_DEVICE_ID_ATI_RS100,
...@@ -436,8 +436,8 @@ static struct agp_device_ids ati_agp_device_ids[] __initdata = ...@@ -436,8 +436,8 @@ static struct agp_device_ids ati_agp_device_ids[] __initdata =
{ }, /* dummy final entry, always present */ { }, /* dummy final entry, always present */
}; };
static int __init agp_ati_probe(struct pci_dev *pdev, static int __devinit agp_ati_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_device_ids *devs = ati_agp_device_ids; struct agp_device_ids *devs = ati_agp_device_ids;
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
......
...@@ -560,8 +560,8 @@ struct agp_bridge_driver intel_i460_driver = { ...@@ -560,8 +560,8 @@ struct agp_bridge_driver intel_i460_driver = {
.cant_use_aperture = 1, .cant_use_aperture = 1,
}; };
static int __init agp_intel_i460_probe(struct pci_dev *pdev, static int __devinit agp_intel_i460_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
u8 cap_ptr; u8 cap_ptr;
......
...@@ -1232,8 +1232,8 @@ static int find_i830(u16 device) ...@@ -1232,8 +1232,8 @@ static int find_i830(u16 device)
return 1; return 1;
} }
static int __init agp_intel_probe(struct pci_dev *pdev, static int __devinit agp_intel_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
char *name = "(unknown)"; char *name = "(unknown)";
......
...@@ -250,8 +250,8 @@ struct agp_bridge_driver nvidia_driver = { ...@@ -250,8 +250,8 @@ struct agp_bridge_driver nvidia_driver = {
.agp_destroy_page = agp_generic_destroy_page, .agp_destroy_page = agp_generic_destroy_page,
}; };
static int __init agp_nvidia_probe(struct pci_dev *pdev, static int __devinit agp_nvidia_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
u8 cap_ptr; u8 cap_ptr;
......
...@@ -95,7 +95,7 @@ struct agp_bridge_driver sis_driver = { ...@@ -95,7 +95,7 @@ struct agp_bridge_driver sis_driver = {
.agp_destroy_page = agp_generic_destroy_page, .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, .device_id = PCI_DEVICE_ID_SI_530,
...@@ -164,8 +164,8 @@ static struct agp_device_ids sis_agp_device_ids[] __initdata = ...@@ -164,8 +164,8 @@ static struct agp_device_ids sis_agp_device_ids[] __initdata =
{ }, /* dummy final entry, always present */ { }, /* dummy final entry, always present */
}; };
static int __init agp_sis_probe(struct pci_dev *pdev, static int __devinit agp_sis_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_device_ids *devs = sis_agp_device_ids; struct agp_device_ids *devs = sis_agp_device_ids;
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
......
...@@ -437,8 +437,8 @@ struct agp_bridge_driver sworks_driver = { ...@@ -437,8 +437,8 @@ struct agp_bridge_driver sworks_driver = {
.agp_destroy_page = agp_generic_destroy_page, .agp_destroy_page = agp_generic_destroy_page,
}; };
static int __init agp_serverworks_probe(struct pci_dev *pdev, static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
struct pci_dev *bridge_dev; struct pci_dev *bridge_dev;
......
...@@ -282,7 +282,7 @@ struct agp_bridge_driver uninorth_agp_driver = { ...@@ -282,7 +282,7 @@ struct agp_bridge_driver uninorth_agp_driver = {
.cant_use_aperture = 1, .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, .device_id = PCI_DEVICE_ID_APPLE_UNI_N_AGP,
.chipset_name = "UniNorth", .chipset_name = "UniNorth",
...@@ -301,8 +301,8 @@ static struct agp_device_ids uninorth_agp_device_ids[] __initdata = { ...@@ -301,8 +301,8 @@ static struct agp_device_ids uninorth_agp_device_ids[] __initdata = {
}, },
}; };
static int __init agp_uninorth_probe(struct pci_dev *pdev, static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_device_ids *devs = uninorth_agp_device_ids; struct agp_device_ids *devs = uninorth_agp_device_ids;
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
......
...@@ -211,7 +211,7 @@ struct agp_bridge_driver via_driver = { ...@@ -211,7 +211,7 @@ struct agp_bridge_driver via_driver = {
.agp_destroy_page = agp_generic_destroy_page, .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, .device_id = PCI_DEVICE_ID_VIA_82C597_0,
...@@ -371,8 +371,8 @@ static void check_via_agp3 (struct agp_bridge_data *bridge) ...@@ -371,8 +371,8 @@ static void check_via_agp3 (struct agp_bridge_data *bridge)
} }
static int __init agp_via_probe(struct pci_dev *pdev, static int __devinit agp_via_probe(struct pci_dev *pdev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct agp_device_ids *devs = via_agp_device_ids; struct agp_device_ids *devs = via_agp_device_ids;
struct agp_bridge_data *bridge; struct agp_bridge_data *bridge;
......
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