[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1417817890-10252-3-git-send-email-irina.tirdea@intel.com>
Date: Sat, 6 Dec 2014 00:18:08 +0200
From: Irina Tirdea <irina.tirdea@...el.com>
To: Jonathan Cameron <jic23@...nel.org>, linux-iio@...r.kernel.org
Cc: Peter Meerwald <pmeerw@...erw.net>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Daniel Baluta <daniel.baluta@...el.com>,
linux-kernel@...r.kernel.org, Irina Tirdea <irina.tirdea@...el.com>
Subject: [PATCH 2/4] 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 <irina.tirdea@...el.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
---
drivers/iio/accel/kxcjk-1013.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index aed3777..7b0a9da 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;
}
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists