aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2010-12-17 09:44:00 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-12-24 13:18:34 -0500
commit5aa68b85951aec91d6a955d1de861325fc9a3ba1 (patch)
tree83e3588b4a31dc4ce9a0bf4230772428ed4604fd /drivers
parent7063c0d942a1af2993531fbe52b4c74c1db818c4 (diff)
spi/mpc52xx-psc-spi: move probe/remove to proper sections
Probe/remove should be in __devinit/__devexit. Found by a section-mismatch warning. Also, copy do_remove() over to remove(). Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index 983fbbfce76e..8a904c1c8485 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -363,7 +363,7 @@ static irqreturn_t mpc52xx_psc_spi_isr(int irq, void *dev_id)
363} 363}
364 364
365/* bus_num is used only for the case dev->platform_data == NULL */ 365/* bus_num is used only for the case dev->platform_data == NULL */
366static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, 366static int __devinit mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
367 u32 size, unsigned int irq, s16 bus_num) 367 u32 size, unsigned int irq, s16 bus_num)
368{ 368{
369 struct fsl_spi_platform_data *pdata = dev->platform_data; 369 struct fsl_spi_platform_data *pdata = dev->platform_data;
@@ -450,22 +450,7 @@ free_master:
450 return ret; 450 return ret;
451} 451}
452 452
453static int __exit mpc52xx_psc_spi_do_remove(struct device *dev) 453static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op,
454{
455 struct spi_master *master = dev_get_drvdata(dev);
456 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(master);
457
458 flush_workqueue(mps->workqueue);
459 destroy_workqueue(mps->workqueue);
460 spi_unregister_master(master);
461 free_irq(mps->irq, mps);
462 if (mps->psc)
463 iounmap(mps->psc);
464
465 return 0;
466}
467
468static int __init mpc52xx_psc_spi_of_probe(struct platform_device *op,
469 const struct of_device_id *match) 454 const struct of_device_id *match)
470{ 455{
471 const u32 *regaddr_p; 456 const u32 *regaddr_p;
@@ -495,9 +480,19 @@ static int __init mpc52xx_psc_spi_of_probe(struct platform_device *op,
495 irq_of_parse_and_map(op->dev.of_node, 0), id); 480 irq_of_parse_and_map(op->dev.of_node, 0), id);
496} 481}
497 482
498static int __exit mpc52xx_psc_spi_of_remove(struct platform_device *op) 483static int __devexit mpc52xx_psc_spi_of_remove(struct platform_device *op)
499{ 484{
500 return mpc52xx_psc_spi_do_remove(&op->dev); 485 struct spi_master *master = dev_get_drvdata(&op->dev);
486 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(master);
487
488 flush_workqueue(mps->workqueue);
489 destroy_workqueue(mps->workqueue);
490 spi_unregister_master(master);
491 free_irq(mps->irq, mps);
492 if (mps->psc)
493 iounmap(mps->psc);
494
495 return 0;
501} 496}
502 497
503static const struct of_device_id mpc52xx_psc_spi_of_match[] = { 498static const struct of_device_id mpc52xx_psc_spi_of_match[] = {
@@ -510,7 +505,7 @@ MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
510 505
511static struct of_platform_driver mpc52xx_psc_spi_of_driver = { 506static struct of_platform_driver mpc52xx_psc_spi_of_driver = {
512 .probe = mpc52xx_psc_spi_of_probe, 507 .probe = mpc52xx_psc_spi_of_probe,
513 .remove = __exit_p(mpc52xx_psc_spi_of_remove), 508 .remove = __devexit_p(mpc52xx_psc_spi_of_remove),
514 .driver = { 509 .driver = {
515 .name = "mpc52xx-psc-spi", 510 .name = "mpc52xx-psc-spi",
516 .owner = THIS_MODULE, 511 .owner = THIS_MODULE,