clockevents: Check state instead of mode in suspend/resume path
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 17 Jun 2015 10:34:46 +0000 (16:04 +0530)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jun 2015 07:27:02 +0000 (09:27 +0200)
commita9d20988ac7db47fec4510cefc966e876a4ce674
tree9f07fc28e85f1bd576fab4b9a703405a0e9512a1
parent0c4a5fc95b1df42651a9b4c1f72d348b3d196ea0
clockevents: Check state instead of mode in suspend/resume path

CLOCK_EVT_MODE_* macros are present for backward compatibility (as most
of the drivers are still using old ->set_mode() interface).

These macro's shouldn't be used anymore in code, that is common to both
driver interfaces, i.e. ->set_mode() and ->set_state_*().

Drivers implementing ->set_state_*() interface, which have their
clkevt->mode set to 0 (clkevt device structures are normally globally
defined), will not participate in suspend/resume as they will always be
marked as UNUSED.

Fix this by checking state of the clockevent device instead of mode,
which is updated for both the interfaces.

Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Cc: alexandre.belloni@free-electrons.com
Cc: sylvain.rochet@finsecur.com
Link: http://lkml.kernel.org/r/a1964eef6e8a47d02b1ff9083c6c91f73f0ff643.1434537215.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/time/clockevents.c