Skip to content

Commit

Permalink
spi/orion: Use module_platform_driver()
Browse files Browse the repository at this point in the history
This patch reduces and simplifies initalization code by
using module_platform_driver().
With this change it's necessary to remove the __init annotation
to avoid section mismatch warnings.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Ezequiel Garcia authored and Grant Likely committed Feb 5, 2013
1 parent c0fde3b commit 41ab724
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/spi/spi-orion.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,20 +513,11 @@ static struct platform_driver orion_spi_driver = {
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(orion_spi_of_match_table),
},
.probe = orion_spi_probe,
.remove = orion_spi_remove,
};

static int __init orion_spi_init(void)
{
return platform_driver_probe(&orion_spi_driver, orion_spi_probe);
}
module_init(orion_spi_init);

static void __exit orion_spi_exit(void)
{
platform_driver_unregister(&orion_spi_driver);
}
module_exit(orion_spi_exit);
module_platform_driver(orion_spi_driver);

MODULE_DESCRIPTION("Orion SPI driver");
MODULE_AUTHOR("Shadi Ammouri <shadi@marvell.com>");
Expand Down

0 comments on commit 41ab724

Please sign in to comment.