diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2014-10-06 11:29:42 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-11-10 12:40:33 +0100 |
commit | 0967edc6ef5c3c181cabde3178ea9f33e5130e4a (patch) | |
tree | f4a76db2682f67544b161714a2f065bb6b0ed614 /drivers/mmc/card | |
parent | 433b7b1210a4ece4f2b4f1b04f31a2f0928c8aa8 (diff) | |
download | lwn-0967edc6ef5c3c181cabde3178ea9f33e5130e4a.tar.gz lwn-0967edc6ef5c3c181cabde3178ea9f33e5130e4a.zip |
mmc: core: Convert the mmc_driver to use the modern PM ops
Instead of having specific mmc system PM callbacks for the mmc driver,
let's convert to use the common ones.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r-- | drivers/mmc/card/block.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index a11451f4f408..dfbdfb995dd3 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -2516,15 +2516,17 @@ static void mmc_blk_shutdown(struct mmc_card *card) _mmc_blk_suspend(card); } -#ifdef CONFIG_PM -static int mmc_blk_suspend(struct mmc_card *card) +#ifdef CONFIG_PM_SLEEP +static int mmc_blk_suspend(struct device *dev) { + struct mmc_card *card = mmc_dev_to_card(dev); return _mmc_blk_suspend(card); } -static int mmc_blk_resume(struct mmc_card *card) +static int mmc_blk_resume(struct device *dev) { struct mmc_blk_data *part_md; + struct mmc_card *card = mmc_dev_to_card(dev); struct mmc_blk_data *md = mmc_get_drvdata(card); if (md) { @@ -2540,19 +2542,17 @@ static int mmc_blk_resume(struct mmc_card *card) } return 0; } -#else -#define mmc_blk_suspend NULL -#define mmc_blk_resume NULL #endif +static SIMPLE_DEV_PM_OPS(mmc_blk_pm_ops, mmc_blk_suspend, mmc_blk_resume); + static struct mmc_driver mmc_driver = { .drv = { .name = "mmcblk", + .pm = &mmc_blk_pm_ops, }, .probe = mmc_blk_probe, .remove = mmc_blk_remove, - .suspend = mmc_blk_suspend, - .resume = mmc_blk_resume, .shutdown = mmc_blk_shutdown, }; |