Skip to content

Commit 1b32999

Browse files
storulfrafaeljw
authored andcommitted
mmc: tmio: Avoid boilerplate code in ->runtime_suspend()
Rather than checking the 'runtime_synced' flag each time the ->runtime_suspend() callback is invoked, let's convert into using dev_pm_domain_start() during ->probe() and drop the corresponding boilerplate code. Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ea71c59 commit 1b32999

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

drivers/mmc/host/tmio_mmc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ struct tmio_mmc_host {
163163
unsigned long last_req_ts;
164164
struct mutex ios_lock; /* protect set_ios() context */
165165
bool native_hotplug;
166-
bool runtime_synced;
167166
bool sdio_irq_enabled;
168167

169168
/* Mandatory callback */

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <linux/module.h>
4040
#include <linux/pagemap.h>
4141
#include <linux/platform_device.h>
42+
#include <linux/pm_domain.h>
4243
#include <linux/pm_qos.h>
4344
#include <linux/pm_runtime.h>
4445
#include <linux/regulator/consumer.h>
@@ -1248,10 +1249,12 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host)
12481249
/* See if we also get DMA */
12491250
tmio_mmc_request_dma(_host, pdata);
12501251

1252+
dev_pm_domain_start(&pdev->dev);
1253+
pm_runtime_get_noresume(&pdev->dev);
1254+
pm_runtime_set_active(&pdev->dev);
12511255
pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
12521256
pm_runtime_use_autosuspend(&pdev->dev);
12531257
pm_runtime_enable(&pdev->dev);
1254-
pm_runtime_get_sync(&pdev->dev);
12551258

12561259
ret = mmc_add_host(mmc);
12571260
if (ret)
@@ -1333,11 +1336,6 @@ int tmio_mmc_host_runtime_resume(struct device *dev)
13331336
{
13341337
struct tmio_mmc_host *host = dev_get_drvdata(dev);
13351338

1336-
if (!host->runtime_synced) {
1337-
host->runtime_synced = true;
1338-
return 0;
1339-
}
1340-
13411339
tmio_mmc_clk_enable(host);
13421340
tmio_mmc_hw_reset(host->mmc);
13431341

0 commit comments

Comments
 (0)