From 13071775e654f2332501c313e96d92836e97ca1e Mon Sep 17 00:00:00 2001 From: Dragos Tatulea Date: Thu, 22 Mar 2012 13:52:03 +0200 Subject: [PATCH] atmel_mxt_ts: don't call suspend/resume handlers twice BZ: 34261 When a driver has earlysuspend handlers that call into normal suspend/resume handlers and both are registered, the latter will get called twice. This patch avoids registering normal pm ops when earlysuspend is enabled. Change-Id: I3f455fac6b9c3f0d06a36db46eee5e32a73b60d5 Signed-off-by: Dragos Tatulea Acked-by: Mathias Nyman Signed-off-by: Artem Bityutskiy Reviewed-on: http://android.intel.com:8080/46939 Reviewed-by: Liu, Hong Reviewed-by: Du, Alek Tested-by: Wang, Zhifeng Reviewed-by: buildbot Tested-by: buildbot --- drivers/input/touchscreen/atmel_mxt_ts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 1f7ac78..b4f8e1e 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1546,7 +1546,8 @@ static struct i2c_driver mxt_driver = { .driver = { .name = "atmel_mxt_ts", .owner = THIS_MODULE, -#ifdef CONFIG_PM +/* Avoid calling into suspend/resume ops twice when earlysuspend enabled */ +#if (defined CONFIG_PM) && !(defined CONFIG_HAS_EARLYSUSPEND) .pm = &mxt_pm_ops, #endif }, -- 2.7.4