atmel_mxt_ts: don't call suspend/resume handlers twice
authorDragos Tatulea <dragos.tatulea@intel.com>
Thu, 22 Mar 2012 11:52:03 +0000 (13:52 +0200)
committerbuildbot <buildbot@intel.com>
Thu, 3 May 2012 14:06:12 +0000 (07:06 -0700)
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 <dragos.tatulea@intel.com>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Reviewed-on: http://android.intel.com:8080/46939
Reviewed-by: Liu, Hong <hong.liu@intel.com>
Reviewed-by: Du, Alek <alek.du@intel.com>
Tested-by: Wang, Zhifeng <zhifeng.wang@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/input/touchscreen/atmel_mxt_ts.c

index 1f7ac78..b4f8e1e 100644 (file)
@@ -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
        },