From: Irina Tirdea <irina.tirdea@intel.com>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Cc: Peter Meerwald <pmeerw@pmeerw.net>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Daniel Baluta <daniel.baluta@intel.com>,
linux-kernel@vger.kernel.org,
Irina Tirdea <irina.tirdea@intel.com>
Subject: [PATCH 2/4] iio: accel: kxcjk-1013: only set power state if CONFIG_PM is defined
Date: Sat, 6 Dec 2014 00:18:08 +0200 [thread overview]
Message-ID: <1417817890-10252-3-git-send-email-irina.tirdea@intel.com> (raw)
In-Reply-To: <1417817890-10252-1-git-send-email-irina.tirdea@intel.com>
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@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.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
next prev parent reply other threads:[~2014-12-05 21:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-05 22:18 [PATCH 0/4] PM fixes for kxcjk-1013 Irina Tirdea
2014-12-05 22:18 ` [PATCH 1/4] iio: accel: kxcjk-1013: always power on device in resume Irina Tirdea
2014-12-06 11:15 ` Jonathan Cameron
2014-12-05 22:18 ` Irina Tirdea [this message]
2014-12-06 11:16 ` [PATCH 2/4] iio: accel: kxcjk-1013: only set power state if CONFIG_PM is defined Jonathan Cameron
2014-12-05 22:18 ` [PATCH 3/4] iio: accel: kxcjk-1013: error handling when set mode fails Irina Tirdea
2014-12-06 11:11 ` Jonathan Cameron
2014-12-05 22:18 ` [PATCH 4/4] iio: accel: kxcjk-1013: power off device if probe fails Irina Tirdea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1417817890-10252-3-git-send-email-irina.tirdea@intel.com \
--to=irina.tirdea@intel.com \
--cc=daniel.baluta@intel.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome