diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-10-05 13:29:49 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-10-24 18:35:47 -0400 |
commit | 940ab88962bc1aff3273a8356d64577a6e386736 (patch) | |
tree | 3d96d0cb30fd3c6e1b17b2a2d264f4d44258a3bb /drivers/spi/spi-xilinx.c | |
parent | 38ada214fad79ff5ebbed58932c5f0c9969d9c91 (diff) |
drivercore: Add helper macro for platform_driver boilerplate
For simple modules that contain a single platform_driver without any
additional setup code then ends up being a block of duplicated
boilerplate. This patch adds a new macro, module_platform_driver(),
which replaces the module_init()/module_exit() registrations with
template functions.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Reviewed-by: Magnus Damm <magnus.damm@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/spi/spi-xilinx.c')
-rw-r--r-- | drivers/spi/spi-xilinx.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index 4d2c75df886c..4c5a663b9fa8 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c | |||
@@ -538,18 +538,7 @@ static struct platform_driver xilinx_spi_driver = { | |||
538 | .of_match_table = xilinx_spi_of_match, | 538 | .of_match_table = xilinx_spi_of_match, |
539 | }, | 539 | }, |
540 | }; | 540 | }; |
541 | 541 | module_platform_driver(xilinx_spi_driver); | |
542 | static int __init xilinx_spi_pltfm_init(void) | ||
543 | { | ||
544 | return platform_driver_register(&xilinx_spi_driver); | ||
545 | } | ||
546 | module_init(xilinx_spi_pltfm_init); | ||
547 | |||
548 | static void __exit xilinx_spi_pltfm_exit(void) | ||
549 | { | ||
550 | platform_driver_unregister(&xilinx_spi_driver); | ||
551 | } | ||
552 | module_exit(xilinx_spi_pltfm_exit); | ||
553 | 542 | ||
554 | MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); | 543 | MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); |
555 | MODULE_DESCRIPTION("Xilinx SPI driver"); | 544 | MODULE_DESCRIPTION("Xilinx SPI driver"); |