From: Irina Tirdea Date: Fri, 5 Dec 2014 22:18:07 +0000 (+0200) Subject: iio: accel: kxcjk-1013: always power on device in resume X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d3653d09891b57f2e8089b8908f24a2e97576a49;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git iio: accel: kxcjk-1013: always power on device in resume 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 Signed-off-by: Irina Tirdea Reviewed-by: Srinivas Pandruvada Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 1720e9a547ff..aed377797ded 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -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;