diff options
author | David Brownell <david-b@pacbell.net> | 2007-10-16 04:27:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:09 -0400 |
commit | d1e44d9ce8589cc4ca0596989fe17130817ebec5 (patch) | |
tree | d1b3bcfe1804ea1871d5e965a2e3f3fa2efa07fc /drivers/spi/omap_uwire.c | |
parent | 86eeb6fe71c79bd0484e17d267034249a6943bd5 (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/omap_uwire.c')
-rw-r--r-- | drivers/spi/omap_uwire.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c index d275c615a73e..8245b5153f30 100644 --- a/drivers/spi/omap_uwire.c +++ b/drivers/spi/omap_uwire.c | |||
@@ -481,7 +481,7 @@ static void uwire_off(struct uwire_spi *uwire) | |||
481 | spi_master_put(uwire->bitbang.master); | 481 | spi_master_put(uwire->bitbang.master); |
482 | } | 482 | } |
483 | 483 | ||
484 | static int uwire_probe(struct platform_device *pdev) | 484 | static int __init uwire_probe(struct platform_device *pdev) |
485 | { | 485 | { |
486 | struct spi_master *master; | 486 | struct spi_master *master; |
487 | struct uwire_spi *uwire; | 487 | struct uwire_spi *uwire; |
@@ -525,7 +525,7 @@ static int uwire_probe(struct platform_device *pdev) | |||
525 | return status; | 525 | return status; |
526 | } | 526 | } |
527 | 527 | ||
528 | static int uwire_remove(struct platform_device *pdev) | 528 | static int __exit uwire_remove(struct platform_device *pdev) |
529 | { | 529 | { |
530 | struct uwire_spi *uwire = dev_get_drvdata(&pdev->dev); | 530 | struct uwire_spi *uwire = dev_get_drvdata(&pdev->dev); |
531 | int status; | 531 | int status; |
@@ -543,8 +543,7 @@ static struct platform_driver uwire_driver = { | |||
543 | .bus = &platform_bus_type, | 543 | .bus = &platform_bus_type, |
544 | .owner = THIS_MODULE, | 544 | .owner = THIS_MODULE, |
545 | }, | 545 | }, |
546 | .probe = uwire_probe, | 546 | .remove = __exit_p(uwire_remove), |
547 | .remove = uwire_remove, | ||
548 | // suspend ... unuse ck | 547 | // suspend ... unuse ck |
549 | // resume ... use ck | 548 | // resume ... use ck |
550 | }; | 549 | }; |
@@ -566,7 +565,7 @@ static int __init omap_uwire_init(void) | |||
566 | omap_writel(val | 0x00AAA000, OMAP730_IO_CONF_9); | 565 | omap_writel(val | 0x00AAA000, OMAP730_IO_CONF_9); |
567 | } | 566 | } |
568 | 567 | ||
569 | return platform_driver_register(&uwire_driver); | 568 | return platform_driver_probe(&uwire_driver, uwire_probe); |
570 | } | 569 | } |
571 | 570 | ||
572 | static void __exit omap_uwire_exit(void) | 571 | static void __exit omap_uwire_exit(void) |