Skip to content

Commit 3670de8

Browse files
Xu Yanggregkh
authored andcommitted
usb: chipdea: core: fix 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. Fixes: a932a80 ("usb: chipidea: core: add sysfs group") cc: <[email protected]> Acked-by: Peter Chen <[email protected]> Signed-off-by: Xu Yang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bbefb7e commit 3670de8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/usb/chipidea/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,9 +984,12 @@ static ssize_t role_store(struct device *dev,
984984
strlen(ci->roles[role]->name)))
985985
break;
986986

987-
if (role == CI_ROLE_END || role == ci->role)
987+
if (role == CI_ROLE_END)
988988
return -EINVAL;
989989

990+
if (role == ci->role)
991+
return n;
992+
990993
pm_runtime_get_sync(dev);
991994
disable_irq(ci->irq);
992995
ci_role_stop(ci);

0 commit comments

Comments
 (0)