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-tegra.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-tegra.c')
-rw-r--r-- | drivers/spi/spi-tegra.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index e8cd58f63e2..ae6d78a3e91 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c | |||
@@ -465,7 +465,7 @@ static int spi_tegra_transfer(struct spi_device *spi, struct spi_message *m) | |||
465 | return 0; | 465 | return 0; |
466 | } | 466 | } |
467 | 467 | ||
468 | static int __init spi_tegra_probe(struct platform_device *pdev) | 468 | static int __devinit spi_tegra_probe(struct platform_device *pdev) |
469 | { | 469 | { |
470 | struct spi_master *master; | 470 | struct spi_master *master; |
471 | struct spi_tegra_data *tspi; | 471 | struct spi_tegra_data *tspi; |
@@ -613,19 +613,9 @@ static struct platform_driver spi_tegra_driver = { | |||
613 | .owner = THIS_MODULE, | 613 | .owner = THIS_MODULE, |
614 | .of_match_table = spi_tegra_of_match_table, | 614 | .of_match_table = spi_tegra_of_match_table, |
615 | }, | 615 | }, |
616 | .probe = spi_tegra_probe, | ||
616 | .remove = __devexit_p(spi_tegra_remove), | 617 | .remove = __devexit_p(spi_tegra_remove), |
617 | }; | 618 | }; |
618 | 619 | module_platform_driver(spi_tegra_driver); | |
619 | static int __init spi_tegra_init(void) | ||
620 | { | ||
621 | return platform_driver_probe(&spi_tegra_driver, spi_tegra_probe); | ||
622 | } | ||
623 | module_init(spi_tegra_init); | ||
624 | |||
625 | static void __exit spi_tegra_exit(void) | ||
626 | { | ||
627 | platform_driver_unregister(&spi_tegra_driver); | ||
628 | } | ||
629 | module_exit(spi_tegra_exit); | ||
630 | 620 | ||
631 | MODULE_LICENSE("GPL"); | 621 | MODULE_LICENSE("GPL"); |