1
0
Fork 0

MLK-23349-6 usb: chipdea: don't return -EINVAL if request role is the same with current role

It should not return -EINVAL if the request role is the same with
current role, return non-error and without do anything instead.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Peter Chen 2020-02-27 16:01:28 +08:00
parent 40688bff75
commit 3800732005
No known key found for this signature in database
GPG Key ID: 4859298150D671BB
1 changed files with 4 additions and 1 deletions

View File

@ -980,9 +980,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);