Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: SBS: Simplify the driver init code

acpi_bus_register_driver() will check acpi_disable and return
-ENODEV, so the acpi_disable check outside the
acpi_bus_register_driver() is duplicated, can be removed.

Also we can just return from acpi_bus_register_driver() then
we can simplify the code further.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Hanjun Guo and committed by
Rafael J. Wysocki
dff71408 ab5369bb

+1 -10
+1 -10
drivers/acpi/sbs.c
··· 714 714 715 715 static int __init acpi_sbs_init(void) 716 716 { 717 - int result = 0; 718 - 719 - if (acpi_disabled) 720 - return -ENODEV; 721 - 722 - result = acpi_bus_register_driver(&acpi_sbs_driver); 723 - if (result < 0) 724 - return -ENODEV; 725 - 726 - return 0; 717 + return acpi_bus_register_driver(&acpi_sbs_driver); 727 718 } 728 719 729 720 static void __exit acpi_sbs_exit(void)