diff options
Diffstat (limited to 'drivers/spi/mpc52xx_psc_spi.c')
-rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 42 |
1 files changed, 18 insertions, 24 deletions
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 983fbbfce76e..e30baf0852ac 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 */ |
366 | static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, | 366 | static 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,23 +450,7 @@ free_master: | |||
450 | return ret; | 450 | return ret; |
451 | } | 451 | } |
452 | 452 | ||
453 | static int __exit mpc52xx_psc_spi_do_remove(struct device *dev) | 453 | static 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 | |||
468 | static int __init mpc52xx_psc_spi_of_probe(struct platform_device *op, | ||
469 | const struct of_device_id *match) | ||
470 | { | 454 | { |
471 | const u32 *regaddr_p; | 455 | const u32 *regaddr_p; |
472 | u64 regaddr64, size64; | 456 | u64 regaddr64, size64; |
@@ -495,9 +479,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); | 479 | irq_of_parse_and_map(op->dev.of_node, 0), id); |
496 | } | 480 | } |
497 | 481 | ||
498 | static int __exit mpc52xx_psc_spi_of_remove(struct platform_device *op) | 482 | static int __devexit mpc52xx_psc_spi_of_remove(struct platform_device *op) |
499 | { | 483 | { |
500 | return mpc52xx_psc_spi_do_remove(&op->dev); | 484 | struct spi_master *master = dev_get_drvdata(&op->dev); |
485 | struct mpc52xx_psc_spi *mps = spi_master_get_devdata(master); | ||
486 | |||
487 | flush_workqueue(mps->workqueue); | ||
488 | destroy_workqueue(mps->workqueue); | ||
489 | spi_unregister_master(master); | ||
490 | free_irq(mps->irq, mps); | ||
491 | if (mps->psc) | ||
492 | iounmap(mps->psc); | ||
493 | |||
494 | return 0; | ||
501 | } | 495 | } |
502 | 496 | ||
503 | static const struct of_device_id mpc52xx_psc_spi_of_match[] = { | 497 | static const struct of_device_id mpc52xx_psc_spi_of_match[] = { |
@@ -508,9 +502,9 @@ static const struct of_device_id mpc52xx_psc_spi_of_match[] = { | |||
508 | 502 | ||
509 | MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); | 503 | MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); |
510 | 504 | ||
511 | static struct of_platform_driver mpc52xx_psc_spi_of_driver = { | 505 | static struct platform_driver mpc52xx_psc_spi_of_driver = { |
512 | .probe = mpc52xx_psc_spi_of_probe, | 506 | .probe = mpc52xx_psc_spi_of_probe, |
513 | .remove = __exit_p(mpc52xx_psc_spi_of_remove), | 507 | .remove = __devexit_p(mpc52xx_psc_spi_of_remove), |
514 | .driver = { | 508 | .driver = { |
515 | .name = "mpc52xx-psc-spi", | 509 | .name = "mpc52xx-psc-spi", |
516 | .owner = THIS_MODULE, | 510 | .owner = THIS_MODULE, |
@@ -520,13 +514,13 @@ static struct of_platform_driver mpc52xx_psc_spi_of_driver = { | |||
520 | 514 | ||
521 | static int __init mpc52xx_psc_spi_init(void) | 515 | static int __init mpc52xx_psc_spi_init(void) |
522 | { | 516 | { |
523 | return of_register_platform_driver(&mpc52xx_psc_spi_of_driver); | 517 | return platform_driver_register(&mpc52xx_psc_spi_of_driver); |
524 | } | 518 | } |
525 | module_init(mpc52xx_psc_spi_init); | 519 | module_init(mpc52xx_psc_spi_init); |
526 | 520 | ||
527 | static void __exit mpc52xx_psc_spi_exit(void) | 521 | static void __exit mpc52xx_psc_spi_exit(void) |
528 | { | 522 | { |
529 | of_unregister_platform_driver(&mpc52xx_psc_spi_of_driver); | 523 | platform_driver_unregister(&mpc52xx_psc_spi_of_driver); |
530 | } | 524 | } |
531 | module_exit(mpc52xx_psc_spi_exit); | 525 | module_exit(mpc52xx_psc_spi_exit); |
532 | 526 | ||