summaryrefslogtreecommitdiff
path: root/drivers/acpi/sbs.c
diff options
context:
space:
mode:
authorHanjun Guo <guohanjun@huawei.com>2020-11-13 05:25:10 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-11-17 20:12:34 +0300
commitdff714087c40644d225094a1f75d2272cc8a4885 (patch)
treef511e564e18b5dda091608a7725dc9d6c516efea /drivers/acpi/sbs.c
parentab5369bba5189f44538bef07943f323992fe964e (diff)
downloadlinux-dff714087c40644d225094a1f75d2272cc8a4885.tar.xz
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>
Diffstat (limited to 'drivers/acpi/sbs.c')
-rw-r--r--drivers/acpi/sbs.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index e6d9f4de2800..cbd1af7ce7f4 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -714,16 +714,7 @@ static struct acpi_driver acpi_sbs_driver = {
static int __init acpi_sbs_init(void)
{
- int result = 0;
-
- if (acpi_disabled)
- return -ENODEV;
-
- result = acpi_bus_register_driver(&acpi_sbs_driver);
- if (result < 0)
- return -ENODEV;
-
- return 0;
+ return acpi_bus_register_driver(&acpi_sbs_driver);
}
static void __exit acpi_sbs_exit(void)