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>
static int bmg160_set_power_state(struct bmg160_data *data, bool on)
{
+#ifdef CONFIG_PM_RUNTIME
int ret;
if (on)
"Failed: bmg160_set_power_state for %d\n", on);
return ret;
}
+#endif
return 0;
}