* [PATCH 1/3] platform/x86: panasonic-laptop: reuse module_acpi_driver
@ 2013-08-28 11:48 Andy Shevchenko
2013-08-28 11:48 ` [PATCH 2/3] platform/x86: intel-smartconnect: " Andy Shevchenko
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Andy Shevchenko @ 2013-08-28 11:48 UTC (permalink / raw)
To: Matthew Garrett, Harald Welte, platform-driver-x86; +Cc: Andy Shevchenko
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>
---
drivers/platform/x86/panasonic-laptop.c | 25 +------------------------
1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index 984253d..014e5ed 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -643,23 +643,6 @@ out_hotkey:
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);
@@ -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);
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/3] platform/x86: intel-smartconnect: reuse module_acpi_driver
2013-08-28 11:48 [PATCH 1/3] platform/x86: panasonic-laptop: reuse module_acpi_driver Andy Shevchenko
@ 2013-08-28 11:48 ` Andy Shevchenko
2013-08-28 11:48 ` [PATCH 3/3] platform/x86: intel-rst: " Andy Shevchenko
2013-09-03 12:07 ` [PATCH 1/3] platform/x86: panasonic-laptop: " Matthew Garrett
2 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2013-08-28 11:48 UTC (permalink / raw)
To: Matthew Garrett, Harald Welte, platform-driver-x86; +Cc: Andy Shevchenko
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>
---
drivers/platform/x86/intel-smartconnect.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/platform/x86/intel-smartconnect.c b/drivers/platform/x86/intel-smartconnect.c
index f74e93d..d207497 100644
--- a/drivers/platform/x86/intel-smartconnect.c
+++ b/drivers/platform/x86/intel-smartconnect.c
@@ -74,17 +74,6 @@ static struct acpi_driver smartconnect_driver = {
},
};
-static int smartconnect_init(void)
-{
- return acpi_bus_register_driver(&smartconnect_driver);
-}
-
-static void smartconnect_exit(void)
-{
- acpi_bus_unregister_driver(&smartconnect_driver);
-}
-
-module_init(smartconnect_init);
-module_exit(smartconnect_exit);
+module_acpi_driver(&smartconnect_driver);
MODULE_DEVICE_TABLE(acpi, smartconnect_ids);
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 3/3] platform/x86: intel-rst: reuse module_acpi_driver
2013-08-28 11:48 [PATCH 1/3] platform/x86: panasonic-laptop: reuse module_acpi_driver Andy Shevchenko
2013-08-28 11:48 ` [PATCH 2/3] platform/x86: intel-smartconnect: " Andy Shevchenko
@ 2013-08-28 11:48 ` Andy Shevchenko
2013-09-03 12:07 ` [PATCH 1/3] platform/x86: panasonic-laptop: " Matthew Garrett
2 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2013-08-28 11:48 UTC (permalink / raw)
To: Matthew Garrett, Harald Welte, platform-driver-x86; +Cc: Andy Shevchenko
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>
---
drivers/platform/x86/intel-rst.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/platform/x86/intel-rst.c b/drivers/platform/x86/intel-rst.c
index 9385afd..fb2f1e2 100644
--- a/drivers/platform/x86/intel-rst.c
+++ b/drivers/platform/x86/intel-rst.c
@@ -193,17 +193,6 @@ static struct acpi_driver irst_driver = {
},
};
-static int irst_init(void)
-{
- return acpi_bus_register_driver(&irst_driver);
-}
-
-static void irst_exit(void)
-{
- acpi_bus_unregister_driver(&irst_driver);
-}
-
-module_init(irst_init);
-module_exit(irst_exit);
+module_acpi_driver(&irst_driver);
MODULE_DEVICE_TABLE(acpi, irst_ids);
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH 1/3] platform/x86: panasonic-laptop: reuse module_acpi_driver
2013-08-28 11:48 [PATCH 1/3] platform/x86: panasonic-laptop: reuse module_acpi_driver Andy Shevchenko
2013-08-28 11:48 ` [PATCH 2/3] platform/x86: intel-smartconnect: " Andy Shevchenko
2013-08-28 11:48 ` [PATCH 3/3] platform/x86: intel-rst: " Andy Shevchenko
@ 2013-09-03 12:07 ` Matthew Garrett
2013-09-03 12:27 ` Andy Shevchenko
2 siblings, 1 reply; 5+ messages in thread
From: Matthew Garrett @ 2013-09-03 12:07 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Harald Welte, platform-driver-x86@vger.kernel.org
On Wed, 2013-08-28 at 14:48 +0300, Andy Shevchenko wrote:
> +module_acpi_driver(&acpi_pcc_driver);
module_acpi_driver(acpi_pcc_driver), right? I've fixed that and applied.
--
Matthew Garrett <matthew.garrett@nebula.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-03 12:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-28 11:48 [PATCH 1/3] platform/x86: panasonic-laptop: reuse module_acpi_driver Andy Shevchenko
2013-08-28 11:48 ` [PATCH 2/3] platform/x86: intel-smartconnect: " Andy Shevchenko
2013-08-28 11:48 ` [PATCH 3/3] platform/x86: intel-rst: " Andy Shevchenko
2013-09-03 12:07 ` [PATCH 1/3] platform/x86: panasonic-laptop: " Matthew Garrett
2013-09-03 12:27 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox