From ef1c6b23355b70356ca18c0d4c39b25dfbd7be02 Mon Sep 17 00:00:00 2001 From: Irina Tirdea Date: Sat, 9 Aug 2014 15:05:00 +0100 Subject: iio: gyro: bmg160: only set power state if PM_RUNTIME is defined When CONFIG_PM_RUNTIME is not defined and bmg160 tries to power off the device, bmg160_set_power_state will call pm_runtime_put_autosuspend, which is not implemented (wil return -ENOSYS). Only call bmg160_set_power_state when CONFIG_PM_RUNTIME is defined. Signed-off-by: Irina Tirdea Acked-by: Hartmut Knaack Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/bmg160.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/iio/gyro') diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c index 80f92a65e020..99acf361aa53 100644 --- a/drivers/iio/gyro/bmg160.c +++ b/drivers/iio/gyro/bmg160.c @@ -237,6 +237,7 @@ static int bmg160_chip_init(struct bmg160_data *data) static int bmg160_set_power_state(struct bmg160_data *data, bool on) { +#ifdef CONFIG_PM_RUNTIME int ret; if (on) @@ -251,6 +252,7 @@ static int bmg160_set_power_state(struct bmg160_data *data, bool on) "Failed: bmg160_set_power_state for %d\n", on); return ret; } +#endif return 0; } -- cgit v1.2.3