Skip to content

Commit

Permalink
platform/x86: panasonic-laptop: reuse module_acpi_driver
Browse files Browse the repository at this point in the history
There is a macro to register and unregister modules in simple cases, Let's use
it and clean up the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
  • Loading branch information
Andy Shevchenko authored and Matthew Garrett committed Sep 5, 2013
1 parent 5ff67df commit 5c07eae
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions drivers/platform/x86/panasonic-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,23 +643,6 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
return result;
}

static int __init acpi_pcc_init(void)
{
int result = 0;

if (acpi_disabled)
return -ENODEV;

result = acpi_bus_register_driver(&acpi_pcc_driver);
if (result < 0) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error registering hotkey driver\n"));
return -ENODEV;
}

return 0;
}

static int acpi_pcc_hotkey_remove(struct acpi_device *device)
{
struct pcc_acpi *pcc = acpi_driver_data(device);
Expand All @@ -679,10 +662,4 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device)
return 0;
}

static void __exit acpi_pcc_exit(void)
{
acpi_bus_unregister_driver(&acpi_pcc_driver);
}

module_init(acpi_pcc_init);
module_exit(acpi_pcc_exit);
module_acpi_driver(acpi_pcc_driver);

0 comments on commit 5c07eae

Please sign in to comment.