ACPI / battery: drop useless return statements
authorLuis Henriques <luis.henriques@canonical.com>
Mon, 11 May 2015 21:48:46 +0000 (22:48 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 13 May 2015 22:58:40 +0000 (00:58 +0200)
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c

index 69b8e607ec359a73a14b2fb83e6f63f7a1b5dfa2..9c676a6f32cef882feff6ffd34e848e64e4252de 100644 (file)
@@ -1292,20 +1292,20 @@ static struct acpi_driver acpi_battery_driver = {
 
 static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)
 {
+       int result;
+
        dmi_check_system(bat_dmi_table);
-       
+
 #ifdef CONFIG_ACPI_PROCFS_POWER
        acpi_battery_dir = acpi_lock_battery_dir();
        if (!acpi_battery_dir)
                return;
 #endif
-       if (acpi_bus_register_driver(&acpi_battery_driver) < 0) {
+       result = acpi_bus_register_driver(&acpi_battery_driver);
 #ifdef CONFIG_ACPI_PROCFS_POWER
+       if (result < 0)
                acpi_unlock_battery_dir(acpi_battery_dir);
 #endif
-               return;
-       }
-       return;
 }
 
 static int __init acpi_battery_init(void)