From: Irina Tirdea Date: Fri, 5 Dec 2014 22:18:08 +0000 (+0200) Subject: iio: accel: kxcjk-1013: only set power state if CONFIG_PM is defined X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c75b8dc84fd28511224a4cd2bfa791bb56a06172;p=linux-beck.git iio: accel: kxcjk-1013: only set power state if CONFIG_PM is defined When CONFIG_PM is not defined and the driver tries to power off the device, kxcjk1013_set_power_state will call pm_runtime_put_autosuspend, which is not implemented (wil return -ENOSYS). Only call pm_runtime calls to change power state when CONFIG_PM is defined. 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 aed377797ded..7b0a9dac7ae3 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -376,6 +376,7 @@ static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data) static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on) { +#ifdef CONFIG_PM int ret; if (on) @@ -389,6 +390,7 @@ static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on) "Failed: kxcjk1013_set_power_state for %d\n", on); return ret; } +#endif return 0; }