From: Jonathan Cameron <jic23@kernel.org>
To: Laurentiu Palcu <laurentiu.palcu@intel.com>, linux-iio@vger.kernel.org
Cc: srinivas.pandruvada@linux.intel.com, knaack.h@gmx.de,
lars@metafoo.de, pmeerw@pmeerw.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iio: accel: BMC150: fix issues when CONFIG_PM_RUNTIME is not set
Date: Sat, 30 Aug 2014 11:45:33 +0100 [thread overview]
Message-ID: <5401AB4D.4000103@kernel.org> (raw)
In-Reply-To: <1409301488-22166-3-git-send-email-laurentiu.palcu@intel.com>
On 29/08/14 09:38, Laurentiu Palcu wrote:
> When CONFIG_PM_RUNTIME is not set, the following issues are seen:
> * warning message at compilation time:
> warning: 'bmc150_accel_get_startup_times' defined but not used [-Wunused-function]
> * bmc150_accel_set_power_state() will always fail and reading the
> accelerometer data is impossible;
Why? Would be good to have an explanation here...
If on is true then it will call pm_runtime_get_sync which calls __pm_runtime_resume
which when CONFIG_PM_RUNTIME is not defined returns 1 which is not an error.
In the on = false case it calls pm_runtime_put_autosuspend which calls __pm_runtime_suspend
which returns -ENOSYS and gives our error.
I'll add something to the patch description to this effect.
>
> This commit fixes these.
>
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> ---
> drivers/iio/accel/bmc150-accel.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/iio/accel/bmc150-accel.c b/drivers/iio/accel/bmc150-accel.c
> index ccb6cf8..0e6566a 100644
> --- a/drivers/iio/accel/bmc150-accel.c
> +++ b/drivers/iio/accel/bmc150-accel.c
> @@ -499,6 +499,7 @@ static int bmc150_accel_get_bw(struct bmc150_accel_data *data, int *val,
> return -EINVAL;
> }
>
> +#ifdef CONFIG_PM_RUNTIME
> static int bmc150_accel_get_startup_times(struct bmc150_accel_data *data)
> {
> int i;
> @@ -529,6 +530,12 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on)
>
> return 0;
> }
> +#else
> +static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on)
> +{
> + return 0;
> +}
> +#endif
>
> static int bmc150_accel_set_scale(struct bmc150_accel_data *data, int val)
> {
>
next prev parent reply other threads:[~2014-08-30 10:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 8:38 [PATCH v2 0/3] iio: accel: BMC150: add support for more Bosch chips Laurentiu Palcu
2014-08-29 8:38 ` [PATCH v2 1/3] iio: accel: BMC150: fix scale value for 16G Laurentiu Palcu
2014-08-30 10:36 ` Jonathan Cameron
2014-08-29 8:38 ` [PATCH v2 2/3] iio: accel: BMC150: fix issues when CONFIG_PM_RUNTIME is not set Laurentiu Palcu
2014-08-30 10:45 ` Jonathan Cameron [this message]
2014-09-01 9:24 ` Laurentiu Palcu
2014-08-29 8:38 ` [PATCH v2 3/3] iio: accel: BMC150: add support for other Bosch chips Laurentiu Palcu
2014-08-30 10:54 ` Jonathan Cameron
2014-09-01 9:11 ` [PATCH v3 " Laurentiu Palcu
2014-09-01 11:02 ` Peter Meerwald
2014-09-01 12:55 ` Laurentiu Palcu
2014-09-01 13:03 ` Laurentiu Palcu
2014-09-01 14:29 ` [PATCH v4 " Laurentiu Palcu
2014-09-02 9:30 ` [PATCH v5 " Laurentiu Palcu
2014-09-10 19:35 ` Jonathan Cameron
2014-09-10 19:43 ` Srinivas Pandruvada
2014-09-13 20:37 ` Jonathan Cameron
2014-09-01 15:36 ` [PATCH v3 " Joe Perches
2014-09-01 15:51 ` Srinivas Pandruvada
2014-09-02 10:30 ` Laurentiu Palcu
2014-09-10 19:32 ` Jonathan Cameron
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=5401AB4D.4000103@kernel.org \
--to=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=laurentiu.palcu@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).