mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-07 13:13:57 +08:00
mmc: sdhci-of-esdhc: Simplify code by using SIMPLE_DEV_PM_OPS
Let's use the SIMPLE_DEV_PM_OPS macro when declaring/assigning the system PM callbacks, as the code gets simplified. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
dafed447eb
commit
9e48b33691
@ -481,7 +481,7 @@ static void esdhc_reset(struct sdhci_host *host, u8 mask)
|
|||||||
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
|
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static u32 esdhc_proctl;
|
static u32 esdhc_proctl;
|
||||||
static int esdhc_of_suspend(struct device *dev)
|
static int esdhc_of_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
@ -504,16 +504,12 @@ static int esdhc_of_resume(struct device *dev)
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dev_pm_ops esdhc_pmops = {
|
|
||||||
.suspend = esdhc_of_suspend,
|
|
||||||
.resume = esdhc_of_resume,
|
|
||||||
};
|
|
||||||
#define ESDHC_PMOPS (&esdhc_pmops)
|
|
||||||
#else
|
|
||||||
#define ESDHC_PMOPS NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(esdhc_of_dev_pm_ops,
|
||||||
|
esdhc_of_suspend,
|
||||||
|
esdhc_of_resume);
|
||||||
|
|
||||||
static const struct sdhci_ops sdhci_esdhc_be_ops = {
|
static const struct sdhci_ops sdhci_esdhc_be_ops = {
|
||||||
.read_l = esdhc_be_readl,
|
.read_l = esdhc_be_readl,
|
||||||
.read_w = esdhc_be_readw,
|
.read_w = esdhc_be_readw,
|
||||||
@ -657,7 +653,7 @@ static struct platform_driver sdhci_esdhc_driver = {
|
|||||||
.driver = {
|
.driver = {
|
||||||
.name = "sdhci-esdhc",
|
.name = "sdhci-esdhc",
|
||||||
.of_match_table = sdhci_esdhc_of_match,
|
.of_match_table = sdhci_esdhc_of_match,
|
||||||
.pm = ESDHC_PMOPS,
|
.pm = &esdhc_of_dev_pm_ops,
|
||||||
},
|
},
|
||||||
.probe = sdhci_esdhc_probe,
|
.probe = sdhci_esdhc_probe,
|
||||||
.remove = sdhci_pltfm_unregister,
|
.remove = sdhci_pltfm_unregister,
|
||||||
|
Loading…
Reference in New Issue
Block a user