diff options
author | Irina Tirdea <irina.tirdea@intel.com> | 2014-08-09 10:05:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2014-09-14 13:29:19 -0400 |
commit | ef1c6b23355b70356ca18c0d4c39b25dfbd7be02 (patch) | |
tree | 90c7354d7a8de60d357c117a00d39a173291bd6c /drivers/iio/gyro | |
parent | c68613777517e538ace751e4e738e238eb216f86 (diff) |
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 <irina.tirdea@intel.com>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r-- | drivers/iio/gyro/bmg160.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
237 | 237 | ||
238 | static int bmg160_set_power_state(struct bmg160_data *data, bool on) | 238 | static int bmg160_set_power_state(struct bmg160_data *data, bool on) |
239 | { | 239 | { |
240 | #ifdef CONFIG_PM_RUNTIME | ||
240 | int ret; | 241 | int ret; |
241 | 242 | ||
242 | if (on) | 243 | if (on) |
@@ -251,6 +252,7 @@ static int bmg160_set_power_state(struct bmg160_data *data, bool on) | |||
251 | "Failed: bmg160_set_power_state for %d\n", on); | 252 | "Failed: bmg160_set_power_state for %d\n", on); |
252 | return ret; | 253 | return ret; |
253 | } | 254 | } |
255 | #endif | ||
254 | 256 | ||
255 | return 0; | 257 | return 0; |
256 | } | 258 | } |