Skip to content

Commit

Permalink
mmc: jz4740: Use pm_ptr() macro
Browse files Browse the repository at this point in the history
Use the newly introduced pm_ptr() macro to simplify the code.

Signed-off-by: Paul Cercueil <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
pcercuei authored and rafaeljw committed Jul 27, 2020
1 parent 756a64c commit 02fd86b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/mmc/host/jz4740_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,32 +1108,26 @@ static int jz4740_mmc_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP

static int jz4740_mmc_suspend(struct device *dev)
static int __maybe_unused jz4740_mmc_suspend(struct device *dev)
{
return pinctrl_pm_select_sleep_state(dev);
}

static int jz4740_mmc_resume(struct device *dev)
static int __maybe_unused jz4740_mmc_resume(struct device *dev)
{
return pinctrl_select_default_state(dev);
}

static SIMPLE_DEV_PM_OPS(jz4740_mmc_pm_ops, jz4740_mmc_suspend,
jz4740_mmc_resume);
#define JZ4740_MMC_PM_OPS (&jz4740_mmc_pm_ops)
#else
#define JZ4740_MMC_PM_OPS NULL
#endif

static struct platform_driver jz4740_mmc_driver = {
.probe = jz4740_mmc_probe,
.remove = jz4740_mmc_remove,
.driver = {
.name = "jz4740-mmc",
.of_match_table = of_match_ptr(jz4740_mmc_of_match),
.pm = JZ4740_MMC_PM_OPS,
.pm = pm_ptr(&jz4740_mmc_pm_ops),
},
};

Expand Down

0 comments on commit 02fd86b

Please sign in to comment.