platform/x86: hp-wireless: reuse module_acpi_driver
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 19 Apr 2017 19:27:31 +0000 (22:27 +0300)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 28 Apr 2017 18:51:25 +0000 (21:51 +0300)
There is a macro to register and unregister modules in simple cases,
Let's use it and clean up the driver.

Cc: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/hp-wireless.c

index d860ea0d0e60c87844ebe4990f074ca913f8bd11..d6ea5e998fb88769c73007b86eac594d06d8c919 100644 (file)
@@ -110,21 +110,4 @@ static struct acpi_driver hpwl_driver = {
        },
 };
 
-static int __init hpwl_init(void)
-{
-       int err;
-
-       err = acpi_bus_register_driver(&hpwl_driver);
-       if (err)
-               pr_err("Unable to register HP wireless control driver.\n");
-
-       return err;
-}
-
-static void __exit hpwl_exit(void)
-{
-       acpi_bus_unregister_driver(&hpwl_driver);
-}
-
-module_init(hpwl_init);
-module_exit(hpwl_exit);
+module_acpi_driver(hpwl_driver);