backlight: convert drivers/video/backlight/* to use module_platform_driver()
authorAxel Lin <axel.lin@gmail.com>
Tue, 10 Jan 2012 23:09:11 +0000 (15:09 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Jan 2012 00:30:48 +0000 (16:30 -0800)
Convert the drivers in drivers/video/backlight/* 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>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> [ep93xx_bl.c]
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 files changed:
drivers/video/backlight/88pm860x_bl.c
drivers/video/backlight/adp5520_bl.c
drivers/video/backlight/da903x_bl.c
drivers/video/backlight/ep93xx_bl.c
drivers/video/backlight/generic_bl.c
drivers/video/backlight/jornada720_bl.c
drivers/video/backlight/jornada720_lcd.c
drivers/video/backlight/max8925_bl.c
drivers/video/backlight/omap1_bl.c
drivers/video/backlight/pcf50633-backlight.c
drivers/video/backlight/platform_lcd.c
drivers/video/backlight/pwm_bl.c
drivers/video/backlight/wm831x_bl.c

index 1105fa1ed7f4a47faf5e26e0796588d4dcaef585..a1376dc73d71cd79492c388afc340d7fba229545 100644 (file)
@@ -270,17 +270,7 @@ static struct platform_driver pm860x_backlight_driver = {
        .remove         = pm860x_backlight_remove,
 };
 
-static int __init pm860x_backlight_init(void)
-{
-       return platform_driver_register(&pm860x_backlight_driver);
-}
-module_init(pm860x_backlight_init);
-
-static void __exit pm860x_backlight_exit(void)
-{
-       platform_driver_unregister(&pm860x_backlight_driver);
-}
-module_exit(pm860x_backlight_exit);
+module_platform_driver(pm860x_backlight_driver);
 
 MODULE_DESCRIPTION("Backlight Driver for Marvell Semiconductor 88PM8606");
 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
index dfb763e9147ff923676e9ff2778116e3677f61ea..2e630bf1164cab84c771da9accb52109b6b69ff7 100644 (file)
@@ -384,17 +384,7 @@ static struct platform_driver adp5520_bl_driver = {
        .resume         = adp5520_bl_resume,
 };
 
-static int __init adp5520_bl_init(void)
-{
-       return platform_driver_register(&adp5520_bl_driver);
-}
-module_init(adp5520_bl_init);
-
-static void __exit adp5520_bl_exit(void)
-{
-       platform_driver_unregister(&adp5520_bl_driver);
-}
-module_exit(adp5520_bl_exit);
+module_platform_driver(adp5520_bl_driver);
 
 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
 MODULE_DESCRIPTION("ADP5520(01) Backlight Driver");
index d68f14bbb687d8391b60f72f8949c3d2c396fbcf..abb4a06268f1831e57815475338447fb83822543 100644 (file)
@@ -199,17 +199,7 @@ static struct platform_driver da903x_backlight_driver = {
        .remove         = da903x_backlight_remove,
 };
 
-static int __init da903x_backlight_init(void)
-{
-       return platform_driver_register(&da903x_backlight_driver);
-}
-module_init(da903x_backlight_init);
-
-static void __exit da903x_backlight_exit(void)
-{
-       platform_driver_unregister(&da903x_backlight_driver);
-}
-module_exit(da903x_backlight_exit);
+module_platform_driver(da903x_backlight_driver);
 
 MODULE_DESCRIPTION("Backlight Driver for Dialog Semiconductor DA9030/DA9034");
 MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"
index c74a6f4baa127a313ea8eea5bf16adde62856b2a..32b91677cd57ee3f3750a10918b2395d9b77a3f6 100644 (file)
@@ -144,17 +144,7 @@ static struct platform_driver ep93xxbl_driver = {
        .resume         = ep93xxbl_resume,
 };
 
-static int __init ep93xxbl_init(void)
-{
-       return platform_driver_register(&ep93xxbl_driver);
-}
-module_init(ep93xxbl_init);
-
-static void __exit ep93xxbl_exit(void)
-{
-       platform_driver_unregister(&ep93xxbl_driver);
-}
-module_exit(ep93xxbl_exit);
+module_platform_driver(ep93xxbl_driver);
 
 MODULE_DESCRIPTION("EP93xx Backlight Driver");
 MODULE_AUTHOR("H Hartley Sweeten <hsweeten@visionengravers.com>");
index adb191466d646355fdfcb5193c80b864631c3919..9ce6170c186079414dcb62123100e7786b032721 100644 (file)
@@ -132,18 +132,7 @@ static struct platform_driver genericbl_driver = {
        },
 };
 
-static int __init genericbl_init(void)
-{
-       return platform_driver_register(&genericbl_driver);
-}
-
-static void __exit genericbl_exit(void)
-{
-       platform_driver_unregister(&genericbl_driver);
-}
-
-module_init(genericbl_init);
-module_exit(genericbl_exit);
+module_platform_driver(genericbl_driver);
 
 MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>");
 MODULE_DESCRIPTION("Generic Backlight Driver");
index de65d80159beed3b90b21313070538b42c3ee4aa..2f8af5d786abbb5971aed6cad8c153229a4b4b84 100644 (file)
@@ -147,19 +147,8 @@ static struct platform_driver jornada_bl_driver = {
        },
 };
 
-static int __init jornada_bl_init(void)
-{
-       return platform_driver_register(&jornada_bl_driver);
-}
-
-static void __exit jornada_bl_exit(void)
-{
-       platform_driver_unregister(&jornada_bl_driver);
-}
+module_platform_driver(jornada_bl_driver);
 
 MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson>");
 MODULE_DESCRIPTION("HP Jornada 710/720/728 Backlight driver");
 MODULE_LICENSE("GPL");
-
-module_init(jornada_bl_init);
-module_exit(jornada_bl_exit);
index d2ff658b4144f91cf6d10a6e04f5178822db26f8..22d231a17e3c4649652ec1992567111e5b70cd6c 100644 (file)
@@ -135,19 +135,8 @@ static struct platform_driver jornada_lcd_driver = {
        },
 };
 
-static int __init jornada_lcd_init(void)
-{
-       return platform_driver_register(&jornada_lcd_driver);
-}
-
-static void __exit jornada_lcd_exit(void)
-{
-       platform_driver_unregister(&jornada_lcd_driver);
-}
+module_platform_driver(jornada_lcd_driver);
 
 MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>");
 MODULE_DESCRIPTION("HP Jornada 710/720/728 LCD driver");
 MODULE_LICENSE("GPL");
-
-module_init(jornada_lcd_init);
-module_exit(jornada_lcd_exit);
index 7bbc802560ea0473229e74ce89b2da299e140fce..c915e3b5388698b2c8c8007167ed531ad5e38580 100644 (file)
@@ -188,17 +188,7 @@ static struct platform_driver max8925_backlight_driver = {
        .remove         = __devexit_p(max8925_backlight_remove),
 };
 
-static int __init max8925_backlight_init(void)
-{
-       return platform_driver_register(&max8925_backlight_driver);
-}
-module_init(max8925_backlight_init);
-
-static void __exit max8925_backlight_exit(void)
-{
-       platform_driver_unregister(&max8925_backlight_driver);
-};
-module_exit(max8925_backlight_exit);
+module_platform_driver(max8925_backlight_driver);
 
 MODULE_DESCRIPTION("Backlight Driver for Maxim MAX8925");
 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
index 08d26a72394c8e9920cc23e115802c642902305d..d8cde277ec83a691c658b9e0afef6c3aef63ffb4 100644 (file)
@@ -195,18 +195,7 @@ static struct platform_driver omapbl_driver = {
        },
 };
 
-static int __init omapbl_init(void)
-{
-       return platform_driver_register(&omapbl_driver);
-}
-
-static void __exit omapbl_exit(void)
-{
-       platform_driver_unregister(&omapbl_driver);
-}
-
-module_init(omapbl_init);
-module_exit(omapbl_exit);
+module_platform_driver(omapbl_driver);
 
 MODULE_AUTHOR("Andrzej Zaborowski <balrog@zabor.org>");
 MODULE_DESCRIPTION("OMAP LCD Backlight driver");
index ef5628d60563841aceab7bca62191c0faf57f763..13e88b71daecc42b5e833c252fd1305a19cc5ed0 100644 (file)
@@ -173,17 +173,7 @@ static struct platform_driver pcf50633_bl_driver = {
        },
 };
 
-static int __init pcf50633_bl_init(void)
-{
-       return platform_driver_register(&pcf50633_bl_driver);
-}
-module_init(pcf50633_bl_init);
-
-static void __exit pcf50633_bl_exit(void)
-{
-       platform_driver_unregister(&pcf50633_bl_driver);
-}
-module_exit(pcf50633_bl_exit);
+module_platform_driver(pcf50633_bl_driver);
 
 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
 MODULE_DESCRIPTION("PCF50633 backlight driver");
index 302330acf6284e0b22e7dc77a6ea055603aa5358..187da59e3a13f652bb44650b9c618c15593039f5 100644 (file)
@@ -157,18 +157,7 @@ static struct platform_driver platform_lcd_driver = {
        .resume         = platform_lcd_resume,
 };
 
-static int __init platform_lcd_init(void)
-{
-       return platform_driver_register(&platform_lcd_driver);
-}
-
-static void __exit platform_lcd_cleanup(void)
-{
-       platform_driver_unregister(&platform_lcd_driver);
-}
-
-module_init(platform_lcd_init);
-module_exit(platform_lcd_cleanup);
+module_platform_driver(platform_lcd_driver);
 
 MODULE_AUTHOR("Ben Dooks <ben-linux@fluff.org>");
 MODULE_LICENSE("GPL v2");
index 8b5b2a4124c7980129be8146f881772f5c33fa97..b811e8fb40627334c348cc2fcea9a72bc93622db 100644 (file)
@@ -207,17 +207,7 @@ static struct platform_driver pwm_backlight_driver = {
        .resume         = pwm_backlight_resume,
 };
 
-static int __init pwm_backlight_init(void)
-{
-       return platform_driver_register(&pwm_backlight_driver);
-}
-module_init(pwm_backlight_init);
-
-static void __exit pwm_backlight_exit(void)
-{
-       platform_driver_unregister(&pwm_backlight_driver);
-}
-module_exit(pwm_backlight_exit);
+module_platform_driver(pwm_backlight_driver);
 
 MODULE_DESCRIPTION("PWM based Backlight Driver");
 MODULE_LICENSE("GPL");
index fbe9e9316f3b51a09e5de299a9a544d878bf5b33..4e915f5eca99b43697e195207150a00bae631f22 100644 (file)
@@ -236,17 +236,7 @@ static struct platform_driver wm831x_backlight_driver = {
        .remove         = wm831x_backlight_remove,
 };
 
-static int __init wm831x_backlight_init(void)
-{
-       return platform_driver_register(&wm831x_backlight_driver);
-}
-module_init(wm831x_backlight_init);
-
-static void __exit wm831x_backlight_exit(void)
-{
-       platform_driver_unregister(&wm831x_backlight_driver);
-}
-module_exit(wm831x_backlight_exit);
+module_platform_driver(wm831x_backlight_driver);
 
 MODULE_DESCRIPTION("Backlight Driver for WM831x PMICs");
 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com");