[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1370593232-3602-2-git-send-email-shuox.liu@intel.com>
Date: Fri, 7 Jun 2013 16:20:31 +0800
From: shuox.liu@...el.com
To: linux-kernel@...r.kernel.org
Cc: linux-pm@...r.kernel.org, pavel@....cz, rjw@...k.pl,
len.brown@...el.com, gregkh@...uxfoundation.org,
yanmin_zhang@...ux.intel.com, ShuoX Liu <shuox.liu@...el.com>,
Zhang Yanmin <yanmin.zhang@...el.com>
Subject: [PATCH 1/2] PM: use dpm_run_callback in device_prepare
From: ShuoX Liu <shuox.liu@...el.com>
dpm_run_callback could show more debug info around prepare stage.
Signed-off-by: Zhang Yanmin <yanmin.zhang@...el.com>
Signed-off-by: Liu ShuoX <shuox.liu@...el.com>
---
drivers/base/power/main.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 5a9b656..cb89323 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1223,7 +1223,7 @@ int dpm_suspend(pm_message_t state)
*/
static int device_prepare(struct device *dev, pm_message_t state)
{
- int (*callback)(struct device *) = NULL;
+ pm_callback_t callback = NULL;
char *info = NULL;
int error = 0;
@@ -1261,10 +1261,7 @@ static int device_prepare(struct device *dev, pm_message_t state)
callback = dev->driver->pm->prepare;
}
- if (callback) {
- error = callback(dev);
- suspend_report_result(callback, error);
- }
+ error = dpm_run_callback(callback, dev, state, info);
device_unlock(dev);
@@ -1280,6 +1277,7 @@ static int device_prepare(struct device *dev, pm_message_t state)
int dpm_prepare(pm_message_t state)
{
int error = 0;
+ ktime_t starttime = ktime_get();
might_sleep();
@@ -1311,6 +1309,7 @@ int dpm_prepare(pm_message_t state)
put_device(dev);
}
mutex_unlock(&dpm_list_mtx);
+ dpm_show_time(starttime, state, "prepare");
return error;
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists