From: Jonathan Cameron <jic23@kernel.org>
To: Adriana Reus <adriana.reus@intel.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/3] iio: light: us5182d: Fix enable status inconcistency
Date: Sat, 12 Dec 2015 14:57:55 +0000 [thread overview]
Message-ID: <566C35F3.408@kernel.org> (raw)
In-Reply-To: <1449661244-18692-2-git-send-email-adriana.reus@intel.com>
On 09/12/15 11:40, Adriana Reus wrote:
> When setting als only or proximity only modes make sure that we mark the other
> component as disabled.
>
> Signed-off-by: Adriana Reus <adriana.reus@intel.com>
Hi Adriana
When you send a fix of any type, please describe the effects of the bug.
That way I have more information to figure out if the bug is tidying up
a loose end or fixing a critical bug and hence judge which path it takes
to upstream.
Please let me know for this one as I can't immediately pick out what the
effects will be.
Jonathan
> ---
> drivers/iio/light/us5182d.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/light/us5182d.c b/drivers/iio/light/us5182d.c
> index 256c4bc..f24b687 100644
> --- a/drivers/iio/light/us5182d.c
> +++ b/drivers/iio/light/us5182d.c
> @@ -238,8 +238,12 @@ static int us5182d_als_enable(struct us5182d_data *data)
> int ret;
> u8 mode;
>
> - if (data->power_mode == US5182D_ONESHOT)
> - return us5182d_set_opmode(data, US5182D_ALS_ONLY);
> + if (data->power_mode == US5182D_ONESHOT) {
> + ret = us5182d_set_opmode(data, US5182D_ALS_ONLY);
> + if (ret < 0)
> + return ret;
> + data->px_enabled = false;
> + }
>
> if (data->als_enabled)
> return 0;
> @@ -260,8 +264,12 @@ static int us5182d_px_enable(struct us5182d_data *data)
> int ret;
> u8 mode;
>
> - if (data->power_mode == US5182D_ONESHOT)
> - return us5182d_set_opmode(data, US5182D_PX_ONLY);
> + if (data->power_mode == US5182D_ONESHOT) {
> + ret = us5182d_set_opmode(data, US5182D_PX_ONLY);
> + if (ret < 0)
> + return ret;
> + data->als_enabled = false;
> + }
>
> if (data->px_enabled)
> return 0;
>
next prev parent reply other threads:[~2015-12-12 14:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 11:40 [PATCH 0/3] iio: light: us5218d: Add interrupt support and some tidying up Adriana Reus
2015-12-09 11:40 ` [PATCH 1/3] iio: light: us5182d: Fix enable status inconcistency Adriana Reus
2015-12-12 14:57 ` Jonathan Cameron [this message]
2015-12-14 9:15 ` Adriana Reus
2015-12-19 16:39 ` Jonathan Cameron
2015-12-09 11:40 ` [PATCH 2/3] iio: light: us5182d: Add interrupt support and events Adriana Reus
2015-12-09 11:40 ` [PATCH 3/3] iio: light: us5182d: Refactor read_raw function Adriana Reus
2015-12-12 15:10 ` 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=566C35F3.408@kernel.org \
--to=jic23@kernel.org \
--cc=adriana.reus@intel.com \
--cc=linux-iio@vger.kernel.org \
/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