Commit 12518563 authored by Takayoshi Kouchi's avatar Takayoshi Kouchi Committed by Greg Kroah-Hartman

[PATCH] [PATCH] PCI Hotplug patch to drivers/pci/names.c

I found that both compaq and ibm PCI hotplug driver call pci_scan_slot(),
which eventually call pci_name_device() in drivers/pci/names.c.

pci_name_device() is declared as __devinit while other data are
declared as __initdata.
This may result in undefined behavior for example, /proc/pci.
parent 7159f489
......@@ -32,18 +32,18 @@ struct pci_vendor_info {
* real memory.. Parse the same file multiple times
* to get all the info.
*/
#define VENDOR( vendor, name ) static char __vendorstr_##vendor[] __initdata = name;
#define VENDOR( vendor, name ) static char __vendorstr_##vendor[] __devinitdata = name;
#define ENDVENDOR()
#define DEVICE( vendor, device, name ) static char __devicestr_##vendor##device[] __initdata = name;
#define DEVICE( vendor, device, name ) static char __devicestr_##vendor##device[] __devinitdata = name;
#include "devlist.h"
#define VENDOR( vendor, name ) static struct pci_device_info __devices_##vendor[] __initdata = {
#define VENDOR( vendor, name ) static struct pci_device_info __devices_##vendor[] __devinitdata = {
#define ENDVENDOR() };
#define DEVICE( vendor, device, name ) { 0x##device, 0, __devicestr_##vendor##device },
#include "devlist.h"
static struct pci_vendor_info __initdata pci_vendor_list[] = {
static struct pci_vendor_info __devinitdata pci_vendor_list[] = {
#define VENDOR( vendor, name ) { 0x##vendor, sizeof(__devices_##vendor) / sizeof(struct pci_device_info), __vendorstr_##vendor, __devices_##vendor },
#define ENDVENDOR()
#define DEVICE( vendor, device, name )
......@@ -121,7 +121,7 @@ pci_class_name(u32 class)
#else
void __init pci_name_device(struct pci_dev *dev)
void __devinit pci_name_device(struct pci_dev *dev)
{
}
......
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