From: Peter Chen <peter.chen@kernel.org>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-imx@nxp.com, jun.li@nxp.com
Subject: Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role
Date: Fri, 10 Feb 2023 16:55:05 +0800 [thread overview]
Message-ID: <20230210085505.GC1991028@nchen-desktop> (raw)
In-Reply-To: <20221130081231.3127369-1-xu.yang_2@nxp.com>
On 22-11-30 16:12:29, Xu Yang wrote:
> It should not return -EINVAL if the request role is the same with current
> role, return non-error and without do anything instead.
>
> Fixes: a932a8041ff9 ("usb: chipidea: core: add sysfs group")
> cc: <stable@vger.kernel.org>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Peter
>
> ---
> changes since v1:
> - no change
> ---
> drivers/usb/chipidea/core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 484b1cd23431..fcb175b22188 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -984,9 +984,12 @@ static ssize_t role_store(struct device *dev,
> strlen(ci->roles[role]->name)))
> break;
>
> - if (role == CI_ROLE_END || role == ci->role)
> + if (role == CI_ROLE_END)
> return -EINVAL;
>
> + if (role == ci->role)
> + return n;
> +
> pm_runtime_get_sync(dev);
> disable_irq(ci->irq);
> ci_role_stop(ci);
> --
> 2.34.1
>
--
Thanks,
Peter Chen
next prev parent reply other threads:[~2023-02-10 8:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 8:12 [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role Xu Yang
2022-11-30 8:12 ` [PATCH v2 2/3] usb: chipidea: core: fix possible concurrent when switch role Xu Yang
2023-01-30 1:55 ` Xu Yang
2023-02-10 8:57 ` Peter Chen
2022-11-30 8:12 ` [PATCH v2 3/3] usb: chipidea: debug: remove redundant 'role' debug file Xu Yang
2023-02-10 8:58 ` Peter Chen
2023-02-10 8:55 ` Peter Chen [this message]
2023-03-16 9:57 ` [EXT] Re: [PATCH v2 1/3] usb: chipdea: core: don't return -EINVAL if request role is the same with current role Xu Yang
2023-03-16 11:54 ` gregkh
2023-03-17 2:37 ` Xu Yang
2023-03-17 4:50 ` gregkh
2023-03-17 5:34 ` Xu Yang
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=20230210085505.GC1991028@nchen-desktop \
--to=peter.chen@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jun.li@nxp.com \
--cc=linux-imx@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=xu.yang_2@nxp.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