Commit c1d1e8a0 authored by Alan Jenkins's avatar Alan Jenkins Committed by Andy Shevchenko

platform/x86: fujitsu-laptop: simplify acpi_bus_register_driver() error handling

A separate variable is not needed to handle error codes returned by
acpi_bus_register_driver().  If the latter fails, just use the value it
returned as the value returned by fujitsu_init().
Signed-off-by: default avatarAlan Jenkins <alan-jenkins@tuffmail.co.uk>
[kempniu: rebase patch, rewrite commit message]
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarJonathan Woithe <jwoithe@just42.net>
parent 8c590e33
...@@ -1192,7 +1192,7 @@ MODULE_DEVICE_TABLE(acpi, fujitsu_ids); ...@@ -1192,7 +1192,7 @@ MODULE_DEVICE_TABLE(acpi, fujitsu_ids);
static int __init fujitsu_init(void) static int __init fujitsu_init(void)
{ {
int ret, result, max_brightness; int ret, max_brightness;
if (acpi_disabled) if (acpi_disabled)
return -ENODEV; return -ENODEV;
...@@ -1207,11 +1207,9 @@ static int __init fujitsu_init(void) ...@@ -1207,11 +1207,9 @@ static int __init fujitsu_init(void)
fujitsu_bl->keycode5 = KEY_RFKILL; fujitsu_bl->keycode5 = KEY_RFKILL;
dmi_check_system(fujitsu_dmi_table); dmi_check_system(fujitsu_dmi_table);
result = acpi_bus_register_driver(&acpi_fujitsu_bl_driver); ret = acpi_bus_register_driver(&acpi_fujitsu_bl_driver);
if (result < 0) { if (ret)
ret = -ENODEV;
goto fail_acpi; goto fail_acpi;
}
/* Register platform stuff */ /* Register platform stuff */
...@@ -1264,11 +1262,9 @@ static int __init fujitsu_init(void) ...@@ -1264,11 +1262,9 @@ static int __init fujitsu_init(void)
goto fail_laptop; goto fail_laptop;
} }
result = acpi_bus_register_driver(&acpi_fujitsu_laptop_driver); ret = acpi_bus_register_driver(&acpi_fujitsu_laptop_driver);
if (result < 0) { if (ret)
ret = -ENODEV;
goto fail_laptop1; goto fail_laptop1;
}
/* Sync backlight power status (needs FUJ02E3 device, hence deferred) */ /* Sync backlight power status (needs FUJ02E3 device, hence deferred) */
if (acpi_video_get_backlight_type() == acpi_backlight_vendor) { if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
......
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