Skip to content

Commit b95a7bd

Browse files
jbeulichIngo Molnar
authored andcommitted
pci, x86/io-apic: Allow PCI_IOAPIC to be user configurable on x86
This adjusts PCI_IOAPIC to be user configurable (possibly as a module) on x86, since the base architecture code for adding IO-APICs dynamically isn't there yet (and hence having the code present everywhere is pretty pointless). To make this consistent, a MODULE_DEVICE_TABLE() declaration gets added, the class specifications get corrected (by properly using PCI_DEVICE_CLASS() intended for purposes like this), and the probe and remove functions get their sections adjusted. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Bjorn Helgaas <bhelgaas@google.com> Link: http://lkml.kernel.org/r/4EDDD71A02000078000659F1@nat28.tlf.novell.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent e4a02b4 commit b95a7bd

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎drivers/pci/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ config PCI_PASID
9898
If unsure, say N.
9999

100100
config PCI_IOAPIC
101-
bool
101+
tristate "PCI IO-APIC hotplug support" if X86
102102
depends on PCI
103103
depends on ACPI
104104
depends on HOTPLUG
105-
default y
105+
default !X86
106106

107107
config PCI_LABEL
108108
def_bool y if (DMI || ACPI)

‎drivers/pci/ioapic.c‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
#include <linux/pci.h>
20-
#include <linux/export.h>
20+
#include <linux/module.h>
2121
#include <linux/acpi.h>
2222
#include <linux/slab.h>
2323
#include <acpi/acpi_bus.h>
@@ -27,7 +27,7 @@ struct ioapic {
2727
u32 gsi_base;
2828
};
2929

30-
static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
30+
static int __devinit ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
3131
{
3232
acpi_handle handle;
3333
acpi_status status;
@@ -88,7 +88,7 @@ static int ioapic_probe(struct pci_dev *dev, const struct pci_device_id *ent)
8888
return -ENODEV;
8989
}
9090

91-
static void ioapic_remove(struct pci_dev *dev)
91+
static void __devexit ioapic_remove(struct pci_dev *dev)
9292
{
9393
struct ioapic *ioapic = pci_get_drvdata(dev);
9494

@@ -99,13 +99,12 @@ static void ioapic_remove(struct pci_dev *dev)
9999
}
100100

101101

102-
static struct pci_device_id ioapic_devices[] = {
103-
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
104-
PCI_CLASS_SYSTEM_PIC_IOAPIC << 8, 0xffff00, },
105-
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
106-
PCI_CLASS_SYSTEM_PIC_IOXAPIC << 8, 0xffff00, },
102+
static DEFINE_PCI_DEVICE_TABLE(ioapic_devices) = {
103+
{ PCI_DEVICE_CLASS(PCI_CLASS_SYSTEM_PIC_IOAPIC, ~0) },
104+
{ PCI_DEVICE_CLASS(PCI_CLASS_SYSTEM_PIC_IOXAPIC, ~0) },
107105
{ }
108106
};
107+
MODULE_DEVICE_TABLE(pci, ioapic_devices);
109108

110109
static struct pci_driver ioapic_driver = {
111110
.name = "ioapic",

0 commit comments

Comments
 (0)