diff options
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r-- | drivers/acpi/ec.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 62068a5e814f..ae3d6d152633 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -1741,7 +1741,7 @@ error: | |||
1741 | * functioning ECDT EC first in order to handle the events. | 1741 | * functioning ECDT EC first in order to handle the events. |
1742 | * https://bugzilla.kernel.org/show_bug.cgi?id=115021 | 1742 | * https://bugzilla.kernel.org/show_bug.cgi?id=115021 |
1743 | */ | 1743 | */ |
1744 | int __init acpi_ec_ecdt_start(void) | 1744 | static int __init acpi_ec_ecdt_start(void) |
1745 | { | 1745 | { |
1746 | acpi_handle handle; | 1746 | acpi_handle handle; |
1747 | 1747 | ||
@@ -2003,20 +2003,17 @@ static inline void acpi_ec_query_exit(void) | |||
2003 | int __init acpi_ec_init(void) | 2003 | int __init acpi_ec_init(void) |
2004 | { | 2004 | { |
2005 | int result; | 2005 | int result; |
2006 | int ecdt_fail, dsdt_fail; | ||
2006 | 2007 | ||
2007 | /* register workqueue for _Qxx evaluations */ | 2008 | /* register workqueue for _Qxx evaluations */ |
2008 | result = acpi_ec_query_init(); | 2009 | result = acpi_ec_query_init(); |
2009 | if (result) | 2010 | if (result) |
2010 | goto err_exit; | 2011 | return result; |
2011 | /* Now register the driver for the EC */ | ||
2012 | result = acpi_bus_register_driver(&acpi_ec_driver); | ||
2013 | if (result) | ||
2014 | goto err_exit; | ||
2015 | 2012 | ||
2016 | err_exit: | 2013 | /* Drivers must be started after acpi_ec_query_init() */ |
2017 | if (result) | 2014 | ecdt_fail = acpi_ec_ecdt_start(); |
2018 | acpi_ec_query_exit(); | 2015 | dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver); |
2019 | return result; | 2016 | return ecdt_fail && dsdt_fail ? -ENODEV : 0; |
2020 | } | 2017 | } |
2021 | 2018 | ||
2022 | /* EC driver currently not unloadable */ | 2019 | /* EC driver currently not unloadable */ |