Skip to content

Commit 5c07eae

Browse files
andy-shevMatthew Garrett
authored andcommitted
platform/x86: panasonic-laptop: reuse module_acpi_driver
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>
1 parent 5ff67df commit 5c07eae

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

drivers/platform/x86/panasonic-laptop.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -643,23 +643,6 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
643643
return result;
644644
}
645645

646-
static int __init acpi_pcc_init(void)
647-
{
648-
int result = 0;
649-
650-
if (acpi_disabled)
651-
return -ENODEV;
652-
653-
result = acpi_bus_register_driver(&acpi_pcc_driver);
654-
if (result < 0) {
655-
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
656-
"Error registering hotkey driver\n"));
657-
return -ENODEV;
658-
}
659-
660-
return 0;
661-
}
662-
663646
static int acpi_pcc_hotkey_remove(struct acpi_device *device)
664647
{
665648
struct pcc_acpi *pcc = acpi_driver_data(device);
@@ -679,10 +662,4 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device)
679662
return 0;
680663
}
681664

682-
static void __exit acpi_pcc_exit(void)
683-
{
684-
acpi_bus_unregister_driver(&acpi_pcc_driver);
685-
}
686-
687-
module_init(acpi_pcc_init);
688-
module_exit(acpi_pcc_exit);
665+
module_acpi_driver(acpi_pcc_driver);

0 commit comments

Comments
 (0)