]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
leds: convert leds-dac124s085 to module_spi_driver
authorAxel Lin <axel.lin@gmail.com>
Fri, 2 Dec 2011 03:12:40 +0000 (14:12 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 2 Dec 2011 03:15:40 +0000 (14:15 +1100)
Factor out some boilerplate code for spi driver registration into
module_spi_driver.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Haojian Zhuang <hzhuang1@marvell.com>
Cc: 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>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/leds/leds-dac124s085.c

index 31cf0d60a9a546052e782d5177b8461c9673d941..d56c14269ff0c7e9c5e40992f689919024cef7bd 100644 (file)
@@ -131,18 +131,7 @@ static struct spi_driver dac124s085_driver = {
        },
 };
 
-static int __init dac124s085_leds_init(void)
-{
-       return spi_register_driver(&dac124s085_driver);
-}
-
-static void __exit dac124s085_leds_exit(void)
-{
-       spi_unregister_driver(&dac124s085_driver);
-}
-
-module_init(dac124s085_leds_init);
-module_exit(dac124s085_leds_exit);
+module_spi_driver(dac124s085_driver);
 
 MODULE_AUTHOR("Guennadi Liakhovetski <lg@denx.de>");
 MODULE_DESCRIPTION("DAC124S085 LED driver");