mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
[ Upstream commit b6ddd180e3d9f92c1e482b3cdeec7dda086b1341 ]
typec_altmode_exit checks if ops->enter is not NULL but then calls
ops->exit a few lines below. Fix that and check for the function
pointer it's about to call instead.
Fixes: 8a37d87d72 ("usb: typec: Bus type for alternate modes")
Signed-off-by: Sven Peter <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
a45ba33d39
commit
af4049a2ff
1 changed files with 1 additions and 1 deletions
|
|
@ -126,7 +126,7 @@ int typec_altmode_exit(struct typec_altmode *adev)
|
|||
if (!adev || !adev->active)
|
||||
return 0;
|
||||
|
||||
if (!pdev->ops || !pdev->ops->enter)
|
||||
if (!pdev->ops || !pdev->ops->exit)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
/* Moving to USB Safe State */
|
||||
|
|
|
|||
Loading…
Reference in a new issue