aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi/pxa2xx_spi.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/pxa2xx_spi.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/pxa2xx_spi.c')
-rw-r--r--drivers/spi/pxa2xx_spi.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 16bf66b7c94..e05918e79ea 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -1229,7 +1229,7 @@ static void cleanup(struct spi_device *spi)
kfree(chip);
}
-static int init_queue(struct driver_data *drv_data)
+static int __init init_queue(struct driver_data *drv_data)
{
INIT_LIST_HEAD(&drv_data->queue);
spin_lock_init(&drv_data->lock);
@@ -1317,7 +1317,7 @@ static int destroy_queue(struct driver_data *drv_data)
return 0;
}
-static int pxa2xx_spi_probe(struct platform_device *pdev)
+static int __init pxa2xx_spi_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct pxa2xx_spi_master *platform_info;
@@ -1621,8 +1621,7 @@ static struct platform_driver driver = {
.bus = &platform_bus_type,
.owner = THIS_MODULE,
},
- .probe = pxa2xx_spi_probe,
- .remove = __devexit_p(pxa2xx_spi_remove),
+ .remove = pxa2xx_spi_remove,
.shutdown = pxa2xx_spi_shutdown,
.suspend = pxa2xx_spi_suspend,
.resume = pxa2xx_spi_resume,
@@ -1630,9 +1629,7 @@ static struct platform_driver driver = {
static int __init pxa2xx_spi_init(void)
{
- platform_driver_register(&driver);
-
- return 0;
+ return platform_driver_probe(&driver, pxa2xx_spi_probe);
}
module_init(pxa2xx_spi_init);