Skip to content

Commit 6037a80

Browse files
jiangliubjorn-helgaas
authored andcommitted
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>
1 parent 5c0b04e commit 6037a80

3 files changed

Lines changed: 10 additions & 17 deletions

File tree

‎drivers/pci/hotplug/Kconfig‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,12 @@ config HOTPLUG_PCI_IBM
5252
When in doubt, say N.
5353

5454
config HOTPLUG_PCI_ACPI
55-
tristate "ACPI PCI Hotplug driver"
56-
depends on (!ACPI_DOCK && ACPI) || (ACPI_DOCK)
55+
bool "ACPI PCI Hotplug driver"
56+
depends on HOTPLUG_PCI=y && ((!ACPI_DOCK && ACPI) || (ACPI_DOCK))
5757
help
5858
Say Y here if you have a system that supports PCI Hotplug using
5959
ACPI.
6060

61-
To compile this driver as a module, choose M here: the
62-
module will be called acpiphp.
63-
6461
When in doubt, say N.
6562

6663
config HOTPLUG_PCI_ACPI_IBM

‎drivers/pci/hotplug/acpiphp.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,6 @@ extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot);
190190

191191
/* variables */
192192
extern bool acpiphp_debug;
193+
extern bool acpiphp_disabled;
193194

194195
#endif /* _ACPIPHP_H */

‎drivers/pci/hotplug/acpiphp_core.c‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define SLOT_NAME_SIZE 21 /* {_SUN} */
4949

5050
bool acpiphp_debug;
51+
bool acpiphp_disabled;
5152

5253
/* local variables */
5354
static struct acpiphp_attention_info *attention_info;
@@ -60,7 +61,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
6061
MODULE_DESCRIPTION(DRIVER_DESC);
6162
MODULE_LICENSE("GPL");
6263
MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
64+
MODULE_PARM_DESC(disable, "disable acpiphp driver");
6365
module_param_named(debug, acpiphp_debug, bool, 0644);
66+
module_param_named(disable, acpiphp_disabled, bool, 0444);
6467

6568
/* export the attention callback registration methods */
6669
EXPORT_SYMBOL_GPL(acpiphp_register_attention);
@@ -353,9 +356,11 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
353356

354357
static int __init acpiphp_init(void)
355358
{
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+
: "");
357362

358-
if (acpi_pci_disabled)
363+
if (acpi_pci_disabled || acpiphp_disabled)
359364
return 0;
360365

361366
/* read all the ACPI info from the system */
@@ -364,14 +369,4 @@ static int __init acpiphp_init(void)
364369
}
365370

366371

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-
376372
module_init(acpiphp_init);
377-
module_exit(acpiphp_exit);

0 commit comments

Comments
 (0)