From: Chanwoo Choi <cw00.choi@samsung.com>
To: Hans de Goede <hdegoede@redhat.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] extcon: Fix attached value returned by is_extcon_changed
Date: Thu, 03 Sep 2015 15:57:36 +0900 [thread overview]
Message-ID: <55E7EF60.7020806@samsung.com> (raw)
In-Reply-To: <1440369336-15795-1-git-send-email-hdegoede@redhat.com>
On 2015년 08월 24일 07:35, Hans de Goede wrote:
> is_extcon_changed should only check the idx-th bit of new, not
> the entirety of new when setting attached.
>
> This fixes extcon sending notifications that a cable was inserted when
> it gets removed while another cable is still connected.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/extcon/extcon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 43b57b0..c4698ce 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
> static bool is_extcon_changed(u32 prev, u32 new, int idx, bool *attached)
> {
> if (((prev >> idx) & 0x1) != ((new >> idx) & 0x1)) {
> - *attached = new ? true : false;
> + *attached = ((new >> idx) & 0x1) ? true : false;
> return true;
> }
>
>
Applied it.
Thanks,
Chanwoo Choi
prev parent reply other threads:[~2015-09-03 6:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-23 22:35 [PATCH] extcon: Fix attached value returned by is_extcon_changed Hans de Goede
2015-09-03 6:57 ` Chanwoo Choi [this message]
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=55E7EF60.7020806@samsung.com \
--to=cw00.choi@samsung.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.