diff options
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r-- | drivers/acpi/button.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index e1eee7a60fad..f1cc4f9d31cd 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -635,4 +635,26 @@ module_param_call(lid_init_state, | |||
635 | NULL, 0644); | 635 | NULL, 0644); |
636 | MODULE_PARM_DESC(lid_init_state, "Behavior for reporting LID initial state"); | 636 | MODULE_PARM_DESC(lid_init_state, "Behavior for reporting LID initial state"); |
637 | 637 | ||
638 | module_acpi_driver(acpi_button_driver); | 638 | static int acpi_button_register_driver(struct acpi_driver *driver) |
639 | { | ||
640 | /* | ||
641 | * Modules such as nouveau.ko and i915.ko have a link time dependency | ||
642 | * on acpi_lid_open(), and would therefore not be loadable on ACPI | ||
643 | * capable kernels booted in non-ACPI mode if the return value of | ||
644 | * acpi_bus_register_driver() is returned from here with ACPI disabled | ||
645 | * when this driver is built as a module. | ||
646 | */ | ||
647 | if (acpi_disabled) | ||
648 | return 0; | ||
649 | |||
650 | return acpi_bus_register_driver(driver); | ||
651 | } | ||
652 | |||
653 | static void acpi_button_unregister_driver(struct acpi_driver *driver) | ||
654 | { | ||
655 | if (!acpi_disabled) | ||
656 | acpi_bus_unregister_driver(driver); | ||
657 | } | ||
658 | |||
659 | module_driver(acpi_button_driver, acpi_button_register_driver, | ||
660 | acpi_button_unregister_driver); | ||