Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: convert led platform drivers to module_platform_driver

Factor out some boilerplate code for platform driver registration into
module_platform_driver.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Haojian Zhuang <hzhuang1@marvell.com> [led-88pm860x.c]
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Axel Lin and committed by
Linus Torvalds
892a8843 e2c17bc6

+31 -265
+1 -11
drivers/leds/leds-88pm860x.c
··· 238 238 .remove = pm860x_led_remove, 239 239 }; 240 240 241 - static int __devinit pm860x_led_init(void) 242 - { 243 - return platform_driver_register(&pm860x_led_driver); 244 - } 245 - module_init(pm860x_led_init); 246 - 247 - static void __devexit pm860x_led_exit(void) 248 - { 249 - platform_driver_unregister(&pm860x_led_driver); 250 - } 251 - module_exit(pm860x_led_exit); 241 + module_platform_driver(pm860x_led_driver); 252 242 253 243 MODULE_DESCRIPTION("LED driver for Marvell PM860x"); 254 244 MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>");
+1 -11
drivers/leds/leds-adp5520.c
··· 213 213 .remove = __devexit_p(adp5520_led_remove), 214 214 }; 215 215 216 - static int __init adp5520_led_init(void) 217 - { 218 - return platform_driver_register(&adp5520_led_driver); 219 - } 220 - module_init(adp5520_led_init); 221 - 222 - static void __exit adp5520_led_exit(void) 223 - { 224 - platform_driver_unregister(&adp5520_led_driver); 225 - } 226 - module_exit(adp5520_led_exit); 216 + module_platform_driver(adp5520_led_driver); 227 217 228 218 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 229 219 MODULE_DESCRIPTION("LEDS ADP5520(01) Driver");
+1 -12
drivers/leds/leds-ams-delta.c
··· 118 118 }, 119 119 }; 120 120 121 - static int __init ams_delta_led_init(void) 122 - { 123 - return platform_driver_register(&ams_delta_led_driver); 124 - } 125 - 126 - static void __exit ams_delta_led_exit(void) 127 - { 128 - platform_driver_unregister(&ams_delta_led_driver); 129 - } 130 - 131 - module_init(ams_delta_led_init); 132 - module_exit(ams_delta_led_exit); 121 + module_platform_driver(ams_delta_led_driver); 133 122 134 123 MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>"); 135 124 MODULE_DESCRIPTION("Amstrad Delta LED driver");
+2 -14
drivers/leds/leds-asic3.c
··· 179 179 }, 180 180 }; 181 181 182 - MODULE_ALIAS("platform:leds-asic3"); 183 - 184 - static int __init asic3_led_init(void) 185 - { 186 - return platform_driver_register(&asic3_led_driver); 187 - } 188 - 189 - static void __exit asic3_led_exit(void) 190 - { 191 - platform_driver_unregister(&asic3_led_driver); 192 - } 193 - 194 - module_init(asic3_led_init); 195 - module_exit(asic3_led_exit); 182 + module_platform_driver(asic3_led_driver); 196 183 197 184 MODULE_AUTHOR("Paul Parsons <lost.distance@yahoo.com>"); 198 185 MODULE_DESCRIPTION("HTC ASIC3 LED driver"); 199 186 MODULE_LICENSE("GPL"); 187 + MODULE_ALIAS("platform:leds-asic3");
+3 -14
drivers/leds/leds-atmel-pwm.c
··· 134 134 return 0; 135 135 } 136 136 137 - /* work with hotplug and coldplug */ 138 - MODULE_ALIAS("platform:leds-atmel-pwm"); 139 - 140 137 static struct platform_driver pwmled_driver = { 141 138 .driver = { 142 139 .name = "leds-atmel-pwm", 143 140 .owner = THIS_MODULE, 144 141 }, 145 142 /* REVISIT add suspend() and resume() methods */ 143 + .probe = pwmled_probe, 146 144 .remove = __exit_p(pwmled_remove), 147 145 }; 148 146 149 - static int __init modinit(void) 150 - { 151 - return platform_driver_probe(&pwmled_driver, pwmled_probe); 152 - } 153 - module_init(modinit); 154 - 155 - static void __exit modexit(void) 156 - { 157 - platform_driver_unregister(&pwmled_driver); 158 - } 159 - module_exit(modexit); 147 + module_platform_driver(pwmled_driver); 160 148 161 149 MODULE_DESCRIPTION("Driver for LEDs with PWM-controlled brightness"); 162 150 MODULE_LICENSE("GPL"); 151 + MODULE_ALIAS("platform:leds-atmel-pwm");
+2 -15
drivers/leds/leds-cobalt-qube.c
··· 75 75 return 0; 76 76 } 77 77 78 - /* work with hotplug and coldplug */ 79 - MODULE_ALIAS("platform:cobalt-qube-leds"); 80 - 81 78 static struct platform_driver cobalt_qube_led_driver = { 82 79 .probe = cobalt_qube_led_probe, 83 80 .remove = __devexit_p(cobalt_qube_led_remove), ··· 84 87 }, 85 88 }; 86 89 87 - static int __init cobalt_qube_led_init(void) 88 - { 89 - return platform_driver_register(&cobalt_qube_led_driver); 90 - } 91 - 92 - static void __exit cobalt_qube_led_exit(void) 93 - { 94 - platform_driver_unregister(&cobalt_qube_led_driver); 95 - } 96 - 97 - module_init(cobalt_qube_led_init); 98 - module_exit(cobalt_qube_led_exit); 90 + module_platform_driver(cobalt_qube_led_driver); 99 91 100 92 MODULE_LICENSE("GPL"); 101 93 MODULE_DESCRIPTION("Front LED support for Cobalt Server"); 102 94 MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); 95 + MODULE_ALIAS("platform:cobalt-qube-leds");
+1 -11
drivers/leds/leds-da903x.c
··· 158 158 .remove = __devexit_p(da903x_led_remove), 159 159 }; 160 160 161 - static int __init da903x_led_init(void) 162 - { 163 - return platform_driver_register(&da903x_led_driver); 164 - } 165 - module_init(da903x_led_init); 166 - 167 - static void __exit da903x_led_exit(void) 168 - { 169 - platform_driver_unregister(&da903x_led_driver); 170 - } 171 - module_exit(da903x_led_exit); 161 + module_platform_driver(da903x_led_driver); 172 162 173 163 MODULE_DESCRIPTION("LEDs driver for Dialog Semiconductor DA9030/DA9034"); 174 164 MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"
+1 -14
drivers/leds/leds-fsg.c
··· 224 224 }, 225 225 }; 226 226 227 - 228 - static int __init fsg_led_init(void) 229 - { 230 - return platform_driver_register(&fsg_led_driver); 231 - } 232 - 233 - static void __exit fsg_led_exit(void) 234 - { 235 - platform_driver_unregister(&fsg_led_driver); 236 - } 237 - 238 - 239 - module_init(fsg_led_init); 240 - module_exit(fsg_led_exit); 227 + module_platform_driver(fsg_led_driver); 241 228 242 229 MODULE_AUTHOR("Rod Whitby <rod@whitby.id.au>"); 243 230 MODULE_DESCRIPTION("Freecom FSG-3 LED driver");
+2 -14
drivers/leds/leds-gpio.c
··· 293 293 }, 294 294 }; 295 295 296 - MODULE_ALIAS("platform:leds-gpio"); 297 - 298 - static int __init gpio_led_init(void) 299 - { 300 - return platform_driver_register(&gpio_led_driver); 301 - } 302 - 303 - static void __exit gpio_led_exit(void) 304 - { 305 - platform_driver_unregister(&gpio_led_driver); 306 - } 307 - 308 - module_init(gpio_led_init); 309 - module_exit(gpio_led_exit); 296 + module_platform_driver(gpio_led_driver); 310 297 311 298 MODULE_AUTHOR("Raphael Assenat <raph@8d.com>, Trent Piepho <tpiepho@freescale.com>"); 312 299 MODULE_DESCRIPTION("GPIO LED driver"); 313 300 MODULE_LICENSE("GPL"); 301 + MODULE_ALIAS("platform:leds-gpio");
+2 -15
drivers/leds/leds-hp6xx.c
··· 79 79 return 0; 80 80 } 81 81 82 - /* work with hotplug and coldplug */ 83 - MODULE_ALIAS("platform:hp6xx-led"); 84 - 85 82 static struct platform_driver hp6xxled_driver = { 86 83 .probe = hp6xxled_probe, 87 84 .remove = hp6xxled_remove, ··· 88 91 }, 89 92 }; 90 93 91 - static int __init hp6xxled_init(void) 92 - { 93 - return platform_driver_register(&hp6xxled_driver); 94 - } 95 - 96 - static void __exit hp6xxled_exit(void) 97 - { 98 - platform_driver_unregister(&hp6xxled_driver); 99 - } 100 - 101 - module_init(hp6xxled_init); 102 - module_exit(hp6xxled_exit); 94 + module_platform_driver(hp6xxled_driver); 103 95 104 96 MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>"); 105 97 MODULE_DESCRIPTION("HP Jornada 6xx LED driver"); 106 98 MODULE_LICENSE("GPL"); 99 + MODULE_ALIAS("platform:hp6xx-led");
+2 -14
drivers/leds/leds-lt3593.c
··· 199 199 }, 200 200 }; 201 201 202 - MODULE_ALIAS("platform:leds-lt3593"); 203 - 204 - static int __init lt3593_led_init(void) 205 - { 206 - return platform_driver_register(&lt3593_led_driver); 207 - } 208 - 209 - static void __exit lt3593_led_exit(void) 210 - { 211 - platform_driver_unregister(&lt3593_led_driver); 212 - } 213 - 214 - module_init(lt3593_led_init); 215 - module_exit(lt3593_led_exit); 202 + module_platform_driver(lt3593_led_driver); 216 203 217 204 MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); 218 205 MODULE_DESCRIPTION("LED driver for LT3593 controllers"); 219 206 MODULE_LICENSE("GPL"); 207 + MODULE_ALIAS("platform:leds-lt3593");
+1 -11
drivers/leds/leds-mc13783.c
··· 385 385 .remove = __devexit_p(mc13783_led_remove), 386 386 }; 387 387 388 - static int __init mc13783_led_init(void) 389 - { 390 - return platform_driver_register(&mc13783_led_driver); 391 - } 392 - module_init(mc13783_led_init); 393 - 394 - static void __exit mc13783_led_exit(void) 395 - { 396 - platform_driver_unregister(&mc13783_led_driver); 397 - } 398 - module_exit(mc13783_led_exit); 388 + module_platform_driver(mc13783_led_driver); 399 389 400 390 MODULE_DESCRIPTION("LEDs driver for Freescale MC13783 PMIC"); 401 391 MODULE_AUTHOR("Philippe Retornaz <philippe.retornaz@epfl.ch>");
+2 -13
drivers/leds/leds-netxbig.c
··· 429 429 .owner = THIS_MODULE, 430 430 }, 431 431 }; 432 - MODULE_ALIAS("platform:leds-netxbig"); 433 432 434 - static int __init netxbig_led_init(void) 435 - { 436 - return platform_driver_register(&netxbig_led_driver); 437 - } 438 - 439 - static void __exit netxbig_led_exit(void) 440 - { 441 - platform_driver_unregister(&netxbig_led_driver); 442 - } 443 - 444 - module_init(netxbig_led_init); 445 - module_exit(netxbig_led_exit); 433 + module_platform_driver(netxbig_led_driver); 446 434 447 435 MODULE_AUTHOR("Simon Guinot <sguinot@lacie.com>"); 448 436 MODULE_DESCRIPTION("LED driver for LaCie xBig Network boards"); 449 437 MODULE_LICENSE("GPL"); 438 + MODULE_ALIAS("platform:leds-netxbig");
+2 -13
drivers/leds/leds-ns2.c
··· 323 323 .owner = THIS_MODULE, 324 324 }, 325 325 }; 326 - MODULE_ALIAS("platform:leds-ns2"); 327 326 328 - static int __init ns2_led_init(void) 329 - { 330 - return platform_driver_register(&ns2_led_driver); 331 - } 332 - 333 - static void __exit ns2_led_exit(void) 334 - { 335 - platform_driver_unregister(&ns2_led_driver); 336 - } 337 - 338 - module_init(ns2_led_init); 339 - module_exit(ns2_led_exit); 327 + module_platform_driver(ns2_led_driver); 340 328 341 329 MODULE_AUTHOR("Simon Guinot <sguinot@lacie.com>"); 342 330 MODULE_DESCRIPTION("Network Space v2 LED driver"); 343 331 MODULE_LICENSE("GPL"); 332 + MODULE_ALIAS("platform:leds-ns2");
+1 -12
drivers/leds/leds-pwm.c
··· 135 135 }, 136 136 }; 137 137 138 - static int __init led_pwm_init(void) 139 - { 140 - return platform_driver_register(&led_pwm_driver); 141 - } 142 - 143 - static void __exit led_pwm_exit(void) 144 - { 145 - platform_driver_unregister(&led_pwm_driver); 146 - } 147 - 148 - module_init(led_pwm_init); 149 - module_exit(led_pwm_exit); 138 + module_platform_driver(led_pwm_driver); 150 139 151 140 MODULE_AUTHOR("Luotao Fu <l.fu@pengutronix.de>"); 152 141 MODULE_DESCRIPTION("PWM LED driver for PXA");
+2 -14
drivers/leds/leds-rb532.c
··· 57 57 }, 58 58 }; 59 59 60 - static int __init rb532_led_init(void) 61 - { 62 - return platform_driver_register(&rb532_led_driver); 63 - } 64 - 65 - static void __exit rb532_led_exit(void) 66 - { 67 - platform_driver_unregister(&rb532_led_driver); 68 - } 69 - 70 - module_init(rb532_led_init); 71 - module_exit(rb532_led_exit); 72 - 73 - MODULE_ALIAS("platform:rb532-led"); 60 + module_platform_driver(rb532_led_driver); 74 61 75 62 MODULE_LICENSE("GPL"); 76 63 MODULE_DESCRIPTION("User LED support for Routerboard532"); 77 64 MODULE_AUTHOR("Phil Sutter <n0-1@freewrt.org>"); 65 + MODULE_ALIAS("platform:rb532-led");
+1 -11
drivers/leds/leds-regulator.c
··· 229 229 .remove = __devexit_p(regulator_led_remove), 230 230 }; 231 231 232 - static int __init regulator_led_init(void) 233 - { 234 - return platform_driver_register(&regulator_led_driver); 235 - } 236 - module_init(regulator_led_init); 237 - 238 - static void __exit regulator_led_exit(void) 239 - { 240 - platform_driver_unregister(&regulator_led_driver); 241 - } 242 - module_exit(regulator_led_exit); 232 + module_platform_driver(regulator_led_driver); 243 233 244 234 MODULE_AUTHOR("Antonio Ospite <ospite@studenti.unina.it>"); 245 235 MODULE_DESCRIPTION("Regulator driven LED driver");
+1 -12
drivers/leds/leds-renesas-tpu.c
··· 339 339 } 340 340 }; 341 341 342 - static int __init r_tpu_init(void) 343 - { 344 - return platform_driver_register(&r_tpu_device_driver); 345 - } 346 - 347 - static void __exit r_tpu_exit(void) 348 - { 349 - platform_driver_unregister(&r_tpu_device_driver); 350 - } 351 - 352 - module_init(r_tpu_init); 353 - module_exit(r_tpu_exit); 342 + module_platform_driver(r_tpu_device_driver); 354 343 355 344 MODULE_AUTHOR("Magnus Damm"); 356 345 MODULE_DESCRIPTION("Renesas TPU LED Driver");
+1 -12
drivers/leds/leds-s3c24xx.c
··· 121 121 }, 122 122 }; 123 123 124 - static int __init s3c24xx_led_init(void) 125 - { 126 - return platform_driver_register(&s3c24xx_led_driver); 127 - } 128 - 129 - static void __exit s3c24xx_led_exit(void) 130 - { 131 - platform_driver_unregister(&s3c24xx_led_driver); 132 - } 133 - 134 - module_init(s3c24xx_led_init); 135 - module_exit(s3c24xx_led_exit); 124 + module_platform_driver(s3c24xx_led_driver); 136 125 137 126 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 138 127 MODULE_DESCRIPTION("S3C24XX LED driver");
+1 -11
drivers/leds/leds-wm831x-status.c
··· 325 325 .remove = wm831x_status_remove, 326 326 }; 327 327 328 - static int __devinit wm831x_status_init(void) 329 - { 330 - return platform_driver_register(&wm831x_status_driver); 331 - } 332 - module_init(wm831x_status_init); 333 - 334 - static void wm831x_status_exit(void) 335 - { 336 - platform_driver_unregister(&wm831x_status_driver); 337 - } 338 - module_exit(wm831x_status_exit); 328 + module_platform_driver(wm831x_status_driver); 339 329 340 330 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); 341 331 MODULE_DESCRIPTION("WM831x status LED driver");
+1 -11
drivers/leds/leds-wm8350.c
··· 295 295 .shutdown = wm8350_led_shutdown, 296 296 }; 297 297 298 - static int __devinit wm8350_led_init(void) 299 - { 300 - return platform_driver_register(&wm8350_led_driver); 301 - } 302 - module_init(wm8350_led_init); 303 - 304 - static void wm8350_led_exit(void) 305 - { 306 - platform_driver_unregister(&wm8350_led_driver); 307 - } 308 - module_exit(wm8350_led_exit); 298 + module_platform_driver(wm8350_led_driver); 309 299 310 300 MODULE_AUTHOR("Mark Brown"); 311 301 MODULE_DESCRIPTION("WM8350 LED driver");