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>
.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
},