Commit f9900f15 authored by Ulf Hansson's avatar Ulf Hansson

mmc: sdhci-pci-core: Simplify code by using SET_SYSTEM_SLEEP_PM_OPS

Convert to define the system PM callbacks to be build for CONFIG_PM_SLEEP
and use the SET_SYSTEM_SLEEP_PM_OPS. In this way the code becomes cleaner.
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent bb4eecf2
...@@ -1413,8 +1413,7 @@ static const struct sdhci_ops sdhci_pci_ops = { ...@@ -1413,8 +1413,7 @@ static const struct sdhci_ops sdhci_pci_ops = {
* * * *
\*****************************************************************************/ \*****************************************************************************/
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int sdhci_pci_suspend(struct device *dev) static int sdhci_pci_suspend(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
...@@ -1496,7 +1495,9 @@ static int sdhci_pci_resume(struct device *dev) ...@@ -1496,7 +1495,9 @@ static int sdhci_pci_resume(struct device *dev)
return 0; return 0;
} }
#endif
#ifdef CONFIG_PM
static int sdhci_pci_runtime_suspend(struct device *dev) static int sdhci_pci_runtime_suspend(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
...@@ -1562,17 +1563,10 @@ static int sdhci_pci_runtime_resume(struct device *dev) ...@@ -1562,17 +1563,10 @@ static int sdhci_pci_runtime_resume(struct device *dev)
return 0; return 0;
} }
#endif
#else /* CONFIG_PM */
#define sdhci_pci_suspend NULL
#define sdhci_pci_resume NULL
#endif /* CONFIG_PM */
static const struct dev_pm_ops sdhci_pci_pm_ops = { static const struct dev_pm_ops sdhci_pci_pm_ops = {
.suspend = sdhci_pci_suspend, SET_SYSTEM_SLEEP_PM_OPS(sdhci_pci_suspend, sdhci_pci_resume)
.resume = sdhci_pci_resume,
SET_RUNTIME_PM_OPS(sdhci_pci_runtime_suspend, SET_RUNTIME_PM_OPS(sdhci_pci_runtime_suspend,
sdhci_pci_runtime_resume, NULL) sdhci_pci_runtime_resume, NULL)
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment