linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it
@ 2012-09-07  7:31 Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 01/12] ACPI: introduce module_acpi_driver() helper macro Mika Westerberg
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

[Resending the series with acks]

This is similar than what is done for other busses before (PCI, I2C, SPI,
platform). It reduces a lot of unnecessary boilerplate code from modules.

We also remove following redundant check on few drivers:

	if (acpi_disabled)
		return -ENODEV;

as this same check is already done at the beginning of
acpi_bus_register_driver().

I think these should all go via ACPI tree because they all depend on the
first patch which touches the ACPI subsystem.

Mika Westerberg (12):
  ACPI: introduce module_acpi_driver() helper macro
  ACPI/button: convert to module_acpi_driver()
  ACPI/fan: convert to module_acpi_driver()
  ACPI/hed: convert to module_acpi_driver()
  ACPI/sbshc: convert to module_acpi_driver()
  i2c-scmi: convert to module_acpi_driver()
  Input: atlas_btns - convert to module_acpi_driver()
  hp_accel: convert to module_acpi_driver()
  ideapad: convert to module_acpi_driver()
  topstar-laptop: convert to module_acpi_driver()
  toshiba_bluetooth: convert to module_acpi_driver()
  xo15-ebook: convert to module_acpi_driver()

 drivers/acpi/button.c                    |   13 +------------
 drivers/acpi/fan.c                       |   22 +---------------------
 drivers/acpi/hed.c                       |   20 +-------------------
 drivers/acpi/sbshc.c                     |   18 +-----------------
 drivers/i2c/busses/i2c-scmi.c            |   14 +-------------
 drivers/input/misc/atlas_btns.c          |   17 +----------------
 drivers/platform/x86/hp_accel.c          |   25 +------------------------
 drivers/platform/x86/ideapad-laptop.c    |   14 +-------------
 drivers/platform/x86/topstar-laptop.c    |   22 +---------------------
 drivers/platform/x86/toshiba_bluetooth.c |   22 +---------------------
 drivers/platform/x86/xo15-ebook.c        |   14 +-------------
 include/acpi/acpi_bus.h                  |   13 +++++++++++++
 12 files changed, 24 insertions(+), 190 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH RESEND 01/12] ACPI: introduce module_acpi_driver() helper macro
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 02/12] ACPI/button: convert to module_acpi_driver() Mika Westerberg
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Add a helper macro module_acpi_driver() which reduces the boilerplate code
for ACPI drivers. This is similar what is done for other busses (PCI, SPI,
I2C etc).

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 include/acpi/acpi_bus.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index bde976e..bddd909 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -381,6 +381,19 @@ int acpi_match_device_ids(struct acpi_device *device,
 int acpi_create_dir(struct acpi_device *);
 void acpi_remove_dir(struct acpi_device *);
 
+
+/**
+ * module_acpi_driver(acpi_driver) - Helper macro for registering an ACPI driver
+ * @__acpi_driver: acpi_driver struct
+ *
+ * Helper macro for ACPI drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_acpi_driver(__acpi_driver) \
+	module_driver(__acpi_driver, acpi_bus_register_driver, \
+		      acpi_bus_unregister_driver)
+
 /*
  * Bind physical devices with ACPI devices
  */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 02/12] ACPI/button: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 01/12] ACPI: introduce module_acpi_driver() helper macro Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 03/12] ACPI/fan: " Mika Westerberg
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/acpi/button.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 314a3b8..f0d936b 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -450,15 +450,4 @@ static int acpi_button_remove(struct acpi_device *device, int type)
 	return 0;
 }
 
-static int __init acpi_button_init(void)
-{
-	return acpi_bus_register_driver(&acpi_button_driver);
-}
-
-static void __exit acpi_button_exit(void)
-{
-	acpi_bus_unregister_driver(&acpi_button_driver);
-}
-
-module_init(acpi_button_init);
-module_exit(acpi_button_exit);
+module_acpi_driver(acpi_button_driver);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 03/12] ACPI/fan: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 01/12] ACPI: introduce module_acpi_driver() helper macro Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 02/12] ACPI/button: convert to module_acpi_driver() Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 04/12] ACPI/hed: " Mika Westerberg
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/acpi/fan.c |   22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index bc36a47..3bd6a54 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -212,24 +212,4 @@ static int acpi_fan_resume(struct device *dev)
 }
 #endif
 
-static int __init acpi_fan_init(void)
-{
-	int result = 0;
-
-	result = acpi_bus_register_driver(&acpi_fan_driver);
-	if (result < 0)
-		return -ENODEV;
-
-	return 0;
-}
-
-static void __exit acpi_fan_exit(void)
-{
-
-	acpi_bus_unregister_driver(&acpi_fan_driver);
-
-	return;
-}
-
-module_init(acpi_fan_init);
-module_exit(acpi_fan_exit);
+module_acpi_driver(acpi_fan_driver);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 04/12] ACPI/hed: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (2 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 03/12] ACPI/fan: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 05/12] ACPI/sbshc: " Mika Westerberg
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/acpi/hed.c |   20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/acpi/hed.c b/drivers/acpi/hed.c
index d0c1967..20a0f2c 100644
--- a/drivers/acpi/hed.c
+++ b/drivers/acpi/hed.c
@@ -86,25 +86,7 @@ static struct acpi_driver acpi_hed_driver = {
 		.notify = acpi_hed_notify,
 	},
 };
-
-static int __init acpi_hed_init(void)
-{
-	if (acpi_disabled)
-		return -ENODEV;
-
-	if (acpi_bus_register_driver(&acpi_hed_driver) < 0)
-		return -ENODEV;
-
-	return 0;
-}
-
-static void __exit acpi_hed_exit(void)
-{
-	acpi_bus_unregister_driver(&acpi_hed_driver);
-}
-
-module_init(acpi_hed_init);
-module_exit(acpi_hed_exit);
+module_acpi_driver(acpi_hed_driver);
 
 ACPI_MODULE_NAME("hed");
 MODULE_AUTHOR("Huang Ying");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 05/12] ACPI/sbshc: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (3 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 04/12] ACPI/hed: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 06/12] i2c-scmi: " Mika Westerberg
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/acpi/sbshc.c |   18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index f8d2a47..cf6129a 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -310,23 +310,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device, int type)
 	return 0;
 }
 
-static int __init acpi_smb_hc_init(void)
-{
-	int result;
-
-	result = acpi_bus_register_driver(&acpi_smb_hc_driver);
-	if (result < 0)
-		return -ENODEV;
-	return 0;
-}
-
-static void __exit acpi_smb_hc_exit(void)
-{
-	acpi_bus_unregister_driver(&acpi_smb_hc_driver);
-}
-
-module_init(acpi_smb_hc_init);
-module_exit(acpi_smb_hc_exit);
+module_acpi_driver(acpi_smb_hc_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Alexey Starikovskiy");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 06/12] i2c-scmi: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (4 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 05/12] ACPI/sbshc: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 07/12] Input: atlas_btns - " Mika Westerberg
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/i2c/busses/i2c-scmi.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c
index 388cbdc..6aafa3d 100644
--- a/drivers/i2c/busses/i2c-scmi.c
+++ b/drivers/i2c/busses/i2c-scmi.c
@@ -426,19 +426,7 @@ static struct acpi_driver acpi_smbus_cmi_driver = {
 		.remove = acpi_smbus_cmi_remove,
 	},
 };
-
-static int __init acpi_smbus_cmi_init(void)
-{
-	return acpi_bus_register_driver(&acpi_smbus_cmi_driver);
-}
-
-static void __exit acpi_smbus_cmi_exit(void)
-{
-	acpi_bus_unregister_driver(&acpi_smbus_cmi_driver);
-}
-
-module_init(acpi_smbus_cmi_init);
-module_exit(acpi_smbus_cmi_exit);
+module_acpi_driver(acpi_smbus_cmi_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Crane Cai <crane.cai@amd.com>");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 07/12] Input: atlas_btns - convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (5 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 06/12] i2c-scmi: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 08/12] hp_accel: " Mika Westerberg
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/misc/atlas_btns.c |   17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/input/misc/atlas_btns.c b/drivers/input/misc/atlas_btns.c
index 601f737..26f1313 100644
--- a/drivers/input/misc/atlas_btns.c
+++ b/drivers/input/misc/atlas_btns.c
@@ -151,22 +151,7 @@ static struct acpi_driver atlas_acpi_driver = {
 		.remove	= atlas_acpi_button_remove,
 	},
 };
-
-static int __init atlas_acpi_init(void)
-{
-	if (acpi_disabled)
-		return -ENODEV;
-
-	return acpi_bus_register_driver(&atlas_acpi_driver);
-}
-
-static void __exit atlas_acpi_exit(void)
-{
-	acpi_bus_unregister_driver(&atlas_acpi_driver);
-}
-
-module_init(atlas_acpi_init);
-module_exit(atlas_acpi_exit);
+module_acpi_driver(atlas_acpi_driver);
 
 MODULE_AUTHOR("Jaya Kumar");
 MODULE_LICENSE("GPL");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 08/12] hp_accel: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (6 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 07/12] Input: atlas_btns - " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 09/12] ideapad: " Mika Westerberg
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Éric Piel <eric.piel@tremplin-utc.net>
---
 drivers/platform/x86/hp_accel.c |   25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index 6b9af98..18d74f2 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -382,31 +382,8 @@ static struct acpi_driver lis3lv02d_driver = {
 	},
 	.drv.pm = HP_ACCEL_PM,
 };
-
-static int __init lis3lv02d_init_module(void)
-{
-	int ret;
-
-	if (acpi_disabled)
-		return -ENODEV;
-
-	ret = acpi_bus_register_driver(&lis3lv02d_driver);
-	if (ret < 0)
-		return ret;
-
-	pr_info("driver loaded\n");
-
-	return 0;
-}
-
-static void __exit lis3lv02d_exit_module(void)
-{
-	acpi_bus_unregister_driver(&lis3lv02d_driver);
-}
+module_acpi_driver(lis3lv02d_driver);
 
 MODULE_DESCRIPTION("Glue between LIS3LV02Dx and HP ACPI BIOS and support for disk protection LED.");
 MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek");
 MODULE_LICENSE("GPL");
-
-module_init(lis3lv02d_init_module);
-module_exit(lis3lv02d_exit_module);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 09/12] ideapad: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (7 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 08/12] hp_accel: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 10/12] topstar-laptop: " Mika Westerberg
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Ike Panhc <ike.pan@canonical.com>
---
 drivers/platform/x86/ideapad-laptop.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index dae7abe..5ff4f2e 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -917,20 +917,8 @@ static struct acpi_driver ideapad_acpi_driver = {
 	.drv.pm = &ideapad_pm,
 	.owner = THIS_MODULE,
 };
-
-static int __init ideapad_acpi_module_init(void)
-{
-	return acpi_bus_register_driver(&ideapad_acpi_driver);
-}
-
-static void __exit ideapad_acpi_module_exit(void)
-{
-	acpi_bus_unregister_driver(&ideapad_acpi_driver);
-}
+module_acpi_driver(ideapad_acpi_driver);
 
 MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
 MODULE_DESCRIPTION("IdeaPad ACPI Extras");
 MODULE_LICENSE("GPL");
-
-module_init(ideapad_acpi_module_init);
-module_exit(ideapad_acpi_module_exit);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 10/12] topstar-laptop: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (8 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 09/12] ideapad: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 11/12] toshiba_bluetooth: " Mika Westerberg
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Herton R. Krzesinski <herton@canonical.com>
---
 drivers/platform/x86/topstar-laptop.c |   22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/platform/x86/topstar-laptop.c b/drivers/platform/x86/topstar-laptop.c
index d528daa..d727bfe 100644
--- a/drivers/platform/x86/topstar-laptop.c
+++ b/drivers/platform/x86/topstar-laptop.c
@@ -186,27 +186,7 @@ static struct acpi_driver acpi_topstar_driver = {
 		.notify = acpi_topstar_notify,
 	},
 };
-
-static int __init topstar_laptop_init(void)
-{
-	int ret;
-
-	ret = acpi_bus_register_driver(&acpi_topstar_driver);
-	if (ret < 0)
-		return ret;
-
-	pr_info("ACPI extras driver loaded\n");
-
-	return 0;
-}
-
-static void __exit topstar_laptop_exit(void)
-{
-	acpi_bus_unregister_driver(&acpi_topstar_driver);
-}
-
-module_init(topstar_laptop_init);
-module_exit(topstar_laptop_exit);
+module_acpi_driver(acpi_topstar_driver);
 
 MODULE_AUTHOR("Herton Ronaldo Krzesinski");
 MODULE_DESCRIPTION("Topstar Laptop ACPI Extras driver");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 11/12] toshiba_bluetooth: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (9 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 10/12] topstar-laptop: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-07  7:31 ` [PATCH RESEND 12/12] xo15-ebook: " Mika Westerberg
  2012-09-21 17:44 ` [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Len Brown
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/platform/x86/toshiba_bluetooth.c |   22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/platform/x86/toshiba_bluetooth.c b/drivers/platform/x86/toshiba_bluetooth.c
index 5e5d631..e95be0b 100644
--- a/drivers/platform/x86/toshiba_bluetooth.c
+++ b/drivers/platform/x86/toshiba_bluetooth.c
@@ -122,30 +122,10 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device)
 	return result;
 }
 
-static int __init toshiba_bt_rfkill_init(void)
-{
-	int result;
-
-	result = acpi_bus_register_driver(&toshiba_bt_rfkill_driver);
-	if (result < 0) {
-		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-				  "Error registering driver\n"));
-		return result;
-	}
-
-	return 0;
-}
-
 static int toshiba_bt_rfkill_remove(struct acpi_device *device, int type)
 {
 	/* clean up */
 	return 0;
 }
 
-static void __exit toshiba_bt_rfkill_exit(void)
-{
-	acpi_bus_unregister_driver(&toshiba_bt_rfkill_driver);
-}
-
-module_init(toshiba_bt_rfkill_init);
-module_exit(toshiba_bt_rfkill_exit);
+module_acpi_driver(toshiba_bt_rfkill_driver);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH RESEND 12/12] xo15-ebook: convert to module_acpi_driver()
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (10 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 11/12] toshiba_bluetooth: " Mika Westerberg
@ 2012-09-07  7:31 ` Mika Westerberg
  2012-09-21 17:44 ` [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Len Brown
  12 siblings, 0 replies; 14+ messages in thread
From: Mika Westerberg @ 2012-09-07  7:31 UTC (permalink / raw)
  To: lenb
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi, Mika Westerberg

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/platform/x86/xo15-ebook.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/platform/x86/xo15-ebook.c b/drivers/platform/x86/xo15-ebook.c
index 38ba39d..16d340c 100644
--- a/drivers/platform/x86/xo15-ebook.c
+++ b/drivers/platform/x86/xo15-ebook.c
@@ -170,16 +170,4 @@ static struct acpi_driver xo15_ebook_driver = {
 	},
 	.drv.pm = &ebook_switch_pm,
 };
-
-static int __init xo15_ebook_init(void)
-{
-	return acpi_bus_register_driver(&xo15_ebook_driver);
-}
-
-static void __exit xo15_ebook_exit(void)
-{
-	acpi_bus_unregister_driver(&xo15_ebook_driver);
-}
-
-module_init(xo15_ebook_init);
-module_exit(xo15_ebook_exit);
+module_acpi_driver(xo15_ebook_driver);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it
  2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
                   ` (11 preceding siblings ...)
  2012-09-07  7:31 ` [PATCH RESEND 12/12] xo15-ebook: " Mika Westerberg
@ 2012-09-21 17:44 ` Len Brown
  12 siblings, 0 replies; 14+ messages in thread
From: Len Brown @ 2012-09-21 17:44 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: rui.zhang, khali, ben-linux, w.sang, dmitry.torokhov, eric.piel,
	mjg, ike.pan, herton, linux-kernel, linux-acpi

Thanks for the refresh, Mika.

It is always a pleasure to apply patches that remove so much
more code than they add!

Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-09-21 17:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07  7:31 [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 01/12] ACPI: introduce module_acpi_driver() helper macro Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 02/12] ACPI/button: convert to module_acpi_driver() Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 03/12] ACPI/fan: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 04/12] ACPI/hed: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 05/12] ACPI/sbshc: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 06/12] i2c-scmi: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 07/12] Input: atlas_btns - " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 08/12] hp_accel: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 09/12] ideapad: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 10/12] topstar-laptop: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 11/12] toshiba_bluetooth: " Mika Westerberg
2012-09-07  7:31 ` [PATCH RESEND 12/12] xo15-ebook: " Mika Westerberg
2012-09-21 17:44 ` [PATCH RESEND 00/12] ACPI: add module_acpi_driver() and convert drivers to it Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).