Commit 1e3e770c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branch 'acpi-video'

* acpi-video:
  ACPI / video: Propagate the error code for acpi_video_register
  ACPI / video: Load the module even if ACPI is disabled
parents 79d22364 28d63403
...@@ -2110,7 +2110,8 @@ static int __init intel_opregion_present(void) ...@@ -2110,7 +2110,8 @@ static int __init intel_opregion_present(void)
int acpi_video_register(void) int acpi_video_register(void)
{ {
int result = 0; int ret;
if (register_count) { if (register_count) {
/* /*
* if the function of acpi_video_register is already called, * if the function of acpi_video_register is already called,
...@@ -2122,9 +2123,9 @@ int acpi_video_register(void) ...@@ -2122,9 +2123,9 @@ int acpi_video_register(void)
mutex_init(&video_list_lock); mutex_init(&video_list_lock);
INIT_LIST_HEAD(&video_bus_head); INIT_LIST_HEAD(&video_bus_head);
result = acpi_bus_register_driver(&acpi_video_bus); ret = acpi_bus_register_driver(&acpi_video_bus);
if (result < 0) if (ret)
return -ENODEV; return ret;
/* /*
* When the acpi_video_bus is loaded successfully, increase * When the acpi_video_bus is loaded successfully, increase
...@@ -2176,6 +2177,17 @@ EXPORT_SYMBOL(acpi_video_unregister_backlight); ...@@ -2176,6 +2177,17 @@ EXPORT_SYMBOL(acpi_video_unregister_backlight);
static int __init acpi_video_init(void) static int __init acpi_video_init(void)
{ {
/*
* Let the module load even if ACPI is disabled (e.g. due to
* a broken BIOS) so that i915.ko can still be loaded on such
* old systems without an AcpiOpRegion.
*
* acpi_video_register() will report -ENODEV later as well due
* to acpi_disabled when i915.ko tries to register itself afterwards.
*/
if (acpi_disabled)
return 0;
dmi_check_system(video_dmi_table); dmi_check_system(video_dmi_table);
if (intel_opregion_present()) if (intel_opregion_present())
......
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