diff options
author | Qipan Li <Qipan.Li@csr.com> | 2014-02-12 11:30:20 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-23 21:01:14 -0500 |
commit | facffed29709313593e6feab3a08d9664874e977 (patch) | |
tree | ebc05addbdd8074816344ef177add17f8c00ab15 /drivers/spi | |
parent | dd7243d6a5de6faaef30cebc554ce8b39d5a3de5 (diff) |
spi: sirf: use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries
use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries, this makes the codes
clean and also enable the ability of hibernation support for sirf SPI.
Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-sirf.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index 61e5eafac92c..5210b94729aa 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c | |||
@@ -693,7 +693,7 @@ static int spi_sirfsoc_remove(struct platform_device *pdev) | |||
693 | return 0; | 693 | return 0; |
694 | } | 694 | } |
695 | 695 | ||
696 | #ifdef CONFIG_PM | 696 | #ifdef CONFIG_PM_SLEEP |
697 | static int spi_sirfsoc_suspend(struct device *dev) | 697 | static int spi_sirfsoc_suspend(struct device *dev) |
698 | { | 698 | { |
699 | struct spi_master *master = dev_get_drvdata(dev); | 699 | struct spi_master *master = dev_get_drvdata(dev); |
@@ -716,12 +716,11 @@ static int spi_sirfsoc_resume(struct device *dev) | |||
716 | 716 | ||
717 | return 0; | 717 | return 0; |
718 | } | 718 | } |
719 | #endif | ||
719 | 720 | ||
720 | static const struct dev_pm_ops spi_sirfsoc_pm_ops = { | 721 | static const struct dev_pm_ops spi_sirfsoc_pm_ops = { |
721 | .suspend = spi_sirfsoc_suspend, | 722 | SET_SYSTEM_SLEEP_PM_OPS(spi_sirfsoc_suspend, spi_sirfsoc_resume) |
722 | .resume = spi_sirfsoc_resume, | ||
723 | }; | 723 | }; |
724 | #endif | ||
725 | 724 | ||
726 | static const struct of_device_id spi_sirfsoc_of_match[] = { | 725 | static const struct of_device_id spi_sirfsoc_of_match[] = { |
727 | { .compatible = "sirf,prima2-spi", }, | 726 | { .compatible = "sirf,prima2-spi", }, |
@@ -734,9 +733,7 @@ static struct platform_driver spi_sirfsoc_driver = { | |||
734 | .driver = { | 733 | .driver = { |
735 | .name = DRIVER_NAME, | 734 | .name = DRIVER_NAME, |
736 | .owner = THIS_MODULE, | 735 | .owner = THIS_MODULE, |
737 | #ifdef CONFIG_PM | ||
738 | .pm = &spi_sirfsoc_pm_ops, | 736 | .pm = &spi_sirfsoc_pm_ops, |
739 | #endif | ||
740 | .of_match_table = spi_sirfsoc_of_match, | 737 | .of_match_table = spi_sirfsoc_of_match, |
741 | }, | 738 | }, |
742 | .probe = spi_sirfsoc_probe, | 739 | .probe = spi_sirfsoc_probe, |