Commit ef1c6b23 authored by Irina Tirdea's avatar Irina Tirdea Committed by Jonathan Cameron

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: default avatarIrina Tirdea <irina.tirdea@intel.com>
Acked-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent c6861377
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment