aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi/spi_mpc83xx.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-10-16 01:27:46 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:09 -0700
commitd1e44d9ce8589cc4ca0596989fe17130817ebec5 (patch)
treed1b3bcfe1804ea1871d5e965a2e3f3fa2efa07fc /drivers/spi/spi_mpc83xx.c
parent86eeb6fe71c79bd0484e17d267034249a6943bd5 (diff)
SPI driver runtime footprint shrinkage
Shrink the runtime footprint of various SPI drivers: - Move the probe() routine into the init section where practical, using platform_driver_probe() to make that safe. This often saves around 1KB. Using platform_driver_probe() can also be a correctness fix, if the probe routine is already marked __init but the driver struct keeps a dangling pointer to it after init section removal. - Likewise move remove() routines into the exit sections. These changes would be inappropriate iff the platform devices were actually hotpluggable (e.g. they're found on optional addon cards, or in an FPGA that's dynamically reprogrammed). In these cases, that's not the situation; it's an SOC controller and the only device is initialized before these drivers. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi/spi_mpc83xx.c')
-rw-r--r--drivers/spi/spi_mpc83xx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c
index 32cda77b31c..4580b9cf625 100644
--- a/drivers/spi/spi_mpc83xx.c
+++ b/drivers/spi/spi_mpc83xx.c
@@ -511,7 +511,7 @@ err:
return ret;
}
-static int __devexit mpc83xx_spi_remove(struct platform_device *dev)
+static int __exit mpc83xx_spi_remove(struct platform_device *dev)
{
struct mpc83xx_spi *mpc83xx_spi;
struct spi_master *master;
@@ -529,8 +529,7 @@ static int __devexit mpc83xx_spi_remove(struct platform_device *dev)
MODULE_ALIAS("mpc83xx_spi"); /* for platform bus hotplug */
static struct platform_driver mpc83xx_spi_driver = {
- .probe = mpc83xx_spi_probe,
- .remove = __devexit_p(mpc83xx_spi_remove),
+ .remove = __exit_p(mpc83xx_spi_remove),
.driver = {
.name = "mpc83xx_spi",
},
@@ -538,7 +537,7 @@ static struct platform_driver mpc83xx_spi_driver = {
static int __init mpc83xx_spi_init(void)
{
- return platform_driver_register(&mpc83xx_spi_driver);
+ return platform_driver_probe(&mpc83xx_spi_driver, mpc83xx_spi_probe);
}
static void __exit mpc83xx_spi_exit(void)