diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-08-09 03:35:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-29 08:57:14 -0400 |
commit | a1216394e620d0dfbb03c712ae3210e7b77c9e11 (patch) | |
tree | 39a4deca074fea48037335d218c27f3b04123cec | |
parent | 8074cf063e410a2c0cf1704c3b31002e21f5df7c (diff) |
spi: Use dev_get_drvdata at appropriate places
Use dev_get_drvdata() instead of platform_get_drvdata(to_platform_device(dev)).
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-bcm63xx.c | 6 | ||||
-rw-r--r-- | drivers/spi/spi-coldfire-qspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-s3c24xx.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-sirf.c | 6 |
4 files changed, 8 insertions, 12 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 6d0df500aa8f..f2b548f5ae99 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c | |||
@@ -480,8 +480,7 @@ static int bcm63xx_spi_remove(struct platform_device *pdev) | |||
480 | #ifdef CONFIG_PM | 480 | #ifdef CONFIG_PM |
481 | static int bcm63xx_spi_suspend(struct device *dev) | 481 | static int bcm63xx_spi_suspend(struct device *dev) |
482 | { | 482 | { |
483 | struct spi_master *master = | 483 | struct spi_master *master = dev_get_drvdata(dev); |
484 | platform_get_drvdata(to_platform_device(dev)); | ||
485 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); | 484 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); |
486 | 485 | ||
487 | spi_master_suspend(master); | 486 | spi_master_suspend(master); |
@@ -493,8 +492,7 @@ static int bcm63xx_spi_suspend(struct device *dev) | |||
493 | 492 | ||
494 | static int bcm63xx_spi_resume(struct device *dev) | 493 | static int bcm63xx_spi_resume(struct device *dev) |
495 | { | 494 | { |
496 | struct spi_master *master = | 495 | struct spi_master *master = dev_get_drvdata(dev); |
497 | platform_get_drvdata(to_platform_device(dev)); | ||
498 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); | 496 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); |
499 | 497 | ||
500 | clk_prepare_enable(bs->clk); | 498 | clk_prepare_enable(bs->clk); |
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 1381acbe19c5..8e07928cadb3 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c | |||
@@ -558,7 +558,7 @@ static int mcfqspi_resume(struct device *dev) | |||
558 | #ifdef CONFIG_PM_RUNTIME | 558 | #ifdef CONFIG_PM_RUNTIME |
559 | static int mcfqspi_runtime_suspend(struct device *dev) | 559 | static int mcfqspi_runtime_suspend(struct device *dev) |
560 | { | 560 | { |
561 | struct mcfqspi *mcfqspi = platform_get_drvdata(to_platform_device(dev)); | 561 | struct mcfqspi *mcfqspi = dev_get_drvdata(dev); |
562 | 562 | ||
563 | clk_disable(mcfqspi->clk); | 563 | clk_disable(mcfqspi->clk); |
564 | 564 | ||
@@ -567,7 +567,7 @@ static int mcfqspi_runtime_suspend(struct device *dev) | |||
567 | 567 | ||
568 | static int mcfqspi_runtime_resume(struct device *dev) | 568 | static int mcfqspi_runtime_resume(struct device *dev) |
569 | { | 569 | { |
570 | struct mcfqspi *mcfqspi = platform_get_drvdata(to_platform_device(dev)); | 570 | struct mcfqspi *mcfqspi = dev_get_drvdata(dev); |
571 | 571 | ||
572 | clk_enable(mcfqspi->clk); | 572 | clk_enable(mcfqspi->clk); |
573 | 573 | ||
diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c index 5d43a2881f5a..ce318d95a6ee 100644 --- a/drivers/spi/spi-s3c24xx.c +++ b/drivers/spi/spi-s3c24xx.c | |||
@@ -690,7 +690,7 @@ static int s3c24xx_spi_remove(struct platform_device *dev) | |||
690 | 690 | ||
691 | static int s3c24xx_spi_suspend(struct device *dev) | 691 | static int s3c24xx_spi_suspend(struct device *dev) |
692 | { | 692 | { |
693 | struct s3c24xx_spi *hw = platform_get_drvdata(to_platform_device(dev)); | 693 | struct s3c24xx_spi *hw = dev_get_drvdata(dev); |
694 | 694 | ||
695 | if (hw->pdata && hw->pdata->gpio_setup) | 695 | if (hw->pdata && hw->pdata->gpio_setup) |
696 | hw->pdata->gpio_setup(hw->pdata, 0); | 696 | hw->pdata->gpio_setup(hw->pdata, 0); |
@@ -701,7 +701,7 @@ static int s3c24xx_spi_suspend(struct device *dev) | |||
701 | 701 | ||
702 | static int s3c24xx_spi_resume(struct device *dev) | 702 | static int s3c24xx_spi_resume(struct device *dev) |
703 | { | 703 | { |
704 | struct s3c24xx_spi *hw = platform_get_drvdata(to_platform_device(dev)); | 704 | struct s3c24xx_spi *hw = dev_get_drvdata(dev); |
705 | 705 | ||
706 | s3c24xx_spi_initialsetup(hw); | 706 | s3c24xx_spi_initialsetup(hw); |
707 | return 0; | 707 | return 0; |
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index fc20bcfd90c3..fc5081ab3677 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c | |||
@@ -599,8 +599,7 @@ static int spi_sirfsoc_remove(struct platform_device *pdev) | |||
599 | #ifdef CONFIG_PM | 599 | #ifdef CONFIG_PM |
600 | static int spi_sirfsoc_suspend(struct device *dev) | 600 | static int spi_sirfsoc_suspend(struct device *dev) |
601 | { | 601 | { |
602 | struct platform_device *pdev = to_platform_device(dev); | 602 | struct spi_master *master = dev_get_drvdata(dev); |
603 | struct spi_master *master = platform_get_drvdata(pdev); | ||
604 | struct sirfsoc_spi *sspi = spi_master_get_devdata(master); | 603 | struct sirfsoc_spi *sspi = spi_master_get_devdata(master); |
605 | 604 | ||
606 | clk_disable(sspi->clk); | 605 | clk_disable(sspi->clk); |
@@ -609,8 +608,7 @@ static int spi_sirfsoc_suspend(struct device *dev) | |||
609 | 608 | ||
610 | static int spi_sirfsoc_resume(struct device *dev) | 609 | static int spi_sirfsoc_resume(struct device *dev) |
611 | { | 610 | { |
612 | struct platform_device *pdev = to_platform_device(dev); | 611 | struct spi_master *master = dev_get_drvdata(dev); |
613 | struct spi_master *master = platform_get_drvdata(pdev); | ||
614 | struct sirfsoc_spi *sspi = spi_master_get_devdata(master); | 612 | struct sirfsoc_spi *sspi = spi_master_get_devdata(master); |
615 | 613 | ||
616 | clk_enable(sspi->clk); | 614 | clk_enable(sspi->clk); |