diff mbox series

[18/25] ACPI: SBS: Simplify the driver init code

Message ID 1600328345-27627-19-git-send-email-guohanjun@huawei.com
State New
Headers show
Series [01/25] ACPI: cmos_rtc: Remove the ACPI_MODULE_NAME() | expand

Commit Message

Hanjun Guo Sept. 17, 2020, 7:38 a.m. UTC
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>
---
 drivers/acpi/sbs.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index f158b8c..ee13960 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -714,16 +714,7 @@  static int acpi_sbs_resume(struct device *dev)
 
 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)