iio: accel: kxcjk-1013: always power on device in resume
authorIrina Tirdea <irina.tirdea@intel.com>
Fri, 5 Dec 2014 22:18:07 +0000 (00:18 +0200)
committerJonathan Cameron <jic23@kernel.org>
Fri, 12 Dec 2014 12:28:26 +0000 (12:28 +0000)
When the system resumes, it will first call system resume and
then runtime suspend (if CONFIG_RUNTIME_PM is enabled).
There is no need to conditionally power on the device in
system resume, so always power it on and leave runtime
suspend to power it off if needed.

Suggested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/kxcjk-1013.c

index 1720e9a547ffec9524a3a66a90e205069c1cf8c1..aed377797ded1f6c2251eb0c9e151df66eb50e9f 100644 (file)
@@ -1354,10 +1354,7 @@ static int kxcjk1013_resume(struct device *dev)
        int ret = 0;
 
        mutex_lock(&data->mutex);
-       /* Check, if the suspend occured while active */
-       if (data->dready_trigger_on || data->motion_trigger_on ||
-                                                       data->ev_enable_state)
-               ret = kxcjk1013_set_mode(data, OPERATION);
+       ret = kxcjk1013_set_mode(data, OPERATION);
        mutex_unlock(&data->mutex);
 
        return ret;