]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
platform-drivers-x86: convert drivers/platform/x86/* to use module_platform_driver()
authorAxel Lin <axel.lin@gmail.com>
Sat, 26 Nov 2011 04:14:37 +0000 (12:14 +0800)
committerMatthew Garrett <mjg@redhat.com>
Tue, 20 Mar 2012 16:02:04 +0000 (12:02 -0400)
This patch converts the drivers in drivers/platform/x86/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Hong Liu <hong.liu@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Cc: Daniel Drake <dsd@laptop.org>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/intel_mid_powerbtn.c
drivers/platform/x86/intel_mid_thermal.c
drivers/platform/x86/xo1-rfkill.c

index f1ae5078b7ecfef330909061dc3e7c1f66c4183a..ff3de343b64ccbfb4a2a758c9acc3d5ad0c3b535 100644 (file)
@@ -118,17 +118,7 @@ static struct platform_driver mfld_pb_driver = {
        .remove = __devexit_p(mfld_pb_remove),
 };
 
-static int __init mfld_pb_init(void)
-{
-       return platform_driver_register(&mfld_pb_driver);
-}
-module_init(mfld_pb_init);
-
-static void __exit mfld_pb_exit(void)
-{
-       platform_driver_unregister(&mfld_pb_driver);
-}
-module_exit(mfld_pb_exit);
+module_platform_driver(mfld_pb_driver);
 
 MODULE_AUTHOR("Hong Liu <hong.liu@intel.com>");
 MODULE_DESCRIPTION("Intel Medfield Power Button Driver");
index ccd7b1f8351929992891f8cf3c31f3e30e9b3998..e4cc99209ff15fe0becbf1aaac64e150a252b52b 100644 (file)
@@ -565,18 +565,7 @@ static struct platform_driver mid_thermal_driver = {
        .id_table = therm_id_table,
 };
 
-static int __init mid_thermal_module_init(void)
-{
-       return platform_driver_register(&mid_thermal_driver);
-}
-
-static void __exit mid_thermal_module_exit(void)
-{
-       platform_driver_unregister(&mid_thermal_driver);
-}
-
-module_init(mid_thermal_module_init);
-module_exit(mid_thermal_module_exit);
+module_platform_driver(mid_thermal_driver);
 
 MODULE_AUTHOR("Durgadoss R <durgadoss.r@intel.com>");
 MODULE_DESCRIPTION("Intel Medfield Platform Thermal Driver");
index e549eeeda121fb28829807899307ace2491a0e4f..41781ed8301c737018494bb30a19677640cc9018 100644 (file)
@@ -67,19 +67,8 @@ static struct platform_driver xo1_rfkill_driver = {
        .remove         = __devexit_p(xo1_rfkill_remove),
 };
 
-static int __init xo1_rfkill_init(void)
-{
-       return platform_driver_register(&xo1_rfkill_driver);
-}
-
-static void __exit xo1_rfkill_exit(void)
-{
-       platform_driver_unregister(&xo1_rfkill_driver);
-}
+module_platform_driver(xo1_rfkill_driver);
 
 MODULE_AUTHOR("Daniel Drake <dsd@laptop.org>");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:xo1-rfkill");
-
-module_init(xo1_rfkill_init);
-module_exit(xo1_rfkill_exit);