diff options
author | Jiang Liu <liuj97@gmail.com> | 2013-04-12 01:44:25 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-04-12 17:38:25 -0400 |
commit | 6037a803b05eef9943fb64982e19964007fb7478 (patch) | |
tree | 3e15b1dfef971b65175c665f97d3ea70507423a8 /drivers/pci | |
parent | 5c0b04e3d913c91aee6e48e567e20a3f67849618 (diff) |
PCI: acpiphp: Convert acpiphp to be builtin only, not modular
Convert acpiphp to be builtin only, with no module option.
Previously, when HOTPLUG_PCI_ACPI=m, users could disable acpiphp by
removing the module or preventing it from loading. That can't be done
if acpiphp is builtin statically, so this adds an "acpiphp.disable"
kernel parameter. If a user needs to use this parameter, it is a bug,
and we want to hear about it.
[bhelgaas: fold in acpiphp.disable here, remove documentation]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/Kconfig | 7 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp.h | 1 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_core.c | 19 |
3 files changed, 10 insertions, 17 deletions
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig index 13e9e63a7266..9fcb87f353d4 100644 --- a/drivers/pci/hotplug/Kconfig +++ b/drivers/pci/hotplug/Kconfig | |||
@@ -52,15 +52,12 @@ config HOTPLUG_PCI_IBM | |||
52 | When in doubt, say N. | 52 | When in doubt, say N. |
53 | 53 | ||
54 | config HOTPLUG_PCI_ACPI | 54 | config HOTPLUG_PCI_ACPI |
55 | tristate "ACPI PCI Hotplug driver" | 55 | bool "ACPI PCI Hotplug driver" |
56 | depends on (!ACPI_DOCK && ACPI) || (ACPI_DOCK) | 56 | depends on HOTPLUG_PCI=y && ((!ACPI_DOCK && ACPI) || (ACPI_DOCK)) |
57 | help | 57 | help |
58 | Say Y here if you have a system that supports PCI Hotplug using | 58 | Say Y here if you have a system that supports PCI Hotplug using |
59 | ACPI. | 59 | ACPI. |
60 | 60 | ||
61 | To compile this driver as a module, choose M here: the | ||
62 | module will be called acpiphp. | ||
63 | |||
64 | When in doubt, say N. | 61 | When in doubt, say N. |
65 | 62 | ||
66 | config HOTPLUG_PCI_ACPI_IBM | 63 | config HOTPLUG_PCI_ACPI_IBM |
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h index 1b311f9db82d..b06ae681d5b7 100644 --- a/drivers/pci/hotplug/acpiphp.h +++ b/drivers/pci/hotplug/acpiphp.h | |||
@@ -190,5 +190,6 @@ extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); | |||
190 | 190 | ||
191 | /* variables */ | 191 | /* variables */ |
192 | extern bool acpiphp_debug; | 192 | extern bool acpiphp_debug; |
193 | extern bool acpiphp_disabled; | ||
193 | 194 | ||
194 | #endif /* _ACPIPHP_H */ | 195 | #endif /* _ACPIPHP_H */ |
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index c2fd3095701f..81adbfa4df1b 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #define SLOT_NAME_SIZE 21 /* {_SUN} */ | 48 | #define SLOT_NAME_SIZE 21 /* {_SUN} */ |
49 | 49 | ||
50 | bool acpiphp_debug; | 50 | bool acpiphp_debug; |
51 | bool acpiphp_disabled; | ||
51 | 52 | ||
52 | /* local variables */ | 53 | /* local variables */ |
53 | static struct acpiphp_attention_info *attention_info; | 54 | static struct acpiphp_attention_info *attention_info; |
@@ -60,7 +61,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR); | |||
60 | MODULE_DESCRIPTION(DRIVER_DESC); | 61 | MODULE_DESCRIPTION(DRIVER_DESC); |
61 | MODULE_LICENSE("GPL"); | 62 | MODULE_LICENSE("GPL"); |
62 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); | 63 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); |
64 | MODULE_PARM_DESC(disable, "disable acpiphp driver"); | ||
63 | module_param_named(debug, acpiphp_debug, bool, 0644); | 65 | module_param_named(debug, acpiphp_debug, bool, 0644); |
66 | module_param_named(disable, acpiphp_disabled, bool, 0444); | ||
64 | 67 | ||
65 | /* export the attention callback registration methods */ | 68 | /* export the attention callback registration methods */ |
66 | EXPORT_SYMBOL_GPL(acpiphp_register_attention); | 69 | EXPORT_SYMBOL_GPL(acpiphp_register_attention); |
@@ -353,9 +356,11 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot) | |||
353 | 356 | ||
354 | static int __init acpiphp_init(void) | 357 | static int __init acpiphp_init(void) |
355 | { | 358 | { |
356 | info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); | 359 | info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n", |
360 | acpiphp_disabled ? ", disabled by user; please report a bug" | ||
361 | : ""); | ||
357 | 362 | ||
358 | if (acpi_pci_disabled) | 363 | if (acpi_pci_disabled || acpiphp_disabled) |
359 | return 0; | 364 | return 0; |
360 | 365 | ||
361 | /* read all the ACPI info from the system */ | 366 | /* read all the ACPI info from the system */ |
@@ -364,14 +369,4 @@ static int __init acpiphp_init(void) | |||
364 | } | 369 | } |
365 | 370 | ||
366 | 371 | ||
367 | static void __exit acpiphp_exit(void) | ||
368 | { | ||
369 | if (acpi_pci_disabled) | ||
370 | return; | ||
371 | |||
372 | /* deallocate internal data structures etc. */ | ||
373 | acpiphp_glue_exit(); | ||
374 | } | ||
375 | |||
376 | module_init(acpiphp_init); | 372 | module_init(acpiphp_init); |
377 | module_exit(acpiphp_exit); | ||