]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
regulator: Convert virtual and userspace regulator consumer drivers to use module_pla...
authorAxel Lin <axel.lin@gmail.com>
Mon, 28 Nov 2011 03:38:39 +0000 (11:38 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 28 Nov 2011 11:49:13 +0000 (11:49 +0000)
This patch converts virtual and userspace regulator consumer drivers to use the
module_platform_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/userspace-consumer.c
drivers/regulator/virtual.c

index fc66551469996a6fa05775fa1d1d1decbae38f8a..518667ef9a0d7e132b57fa92cb37397b6c799d9c 100644 (file)
@@ -185,18 +185,7 @@ static struct platform_driver regulator_userspace_consumer_driver = {
        },
 };
 
-
-static int __init regulator_userspace_consumer_init(void)
-{
-       return platform_driver_register(&regulator_userspace_consumer_driver);
-}
-module_init(regulator_userspace_consumer_init);
-
-static void __exit regulator_userspace_consumer_exit(void)
-{
-       platform_driver_unregister(&regulator_userspace_consumer_driver);
-}
-module_exit(regulator_userspace_consumer_exit);
+module_platform_driver(regulator_userspace_consumer_driver);
 
 MODULE_AUTHOR("Mike Rapoport <mike@compulab.co.il>");
 MODULE_DESCRIPTION("Userspace consumer for voltage and current regulators");
index 858c1f861ba596d134c253d74ba7d06d330ea0ff..ee0b161c998fd64ad276e228615ab47cefb178e3 100644 (file)
@@ -352,17 +352,7 @@ static struct platform_driver regulator_virtual_consumer_driver = {
        },
 };
 
-static int __init regulator_virtual_consumer_init(void)
-{
-       return platform_driver_register(&regulator_virtual_consumer_driver);
-}
-module_init(regulator_virtual_consumer_init);
-
-static void __exit regulator_virtual_consumer_exit(void)
-{
-       platform_driver_unregister(&regulator_virtual_consumer_driver);
-}
-module_exit(regulator_virtual_consumer_exit);
+module_platform_driver(regulator_virtual_consumer_driver);
 
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
 MODULE_DESCRIPTION("Virtual regulator consumer");