mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
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 <sven@svenpeter.dev>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20221114165924.33487-1-sven@svenpeter.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7b462b05e4
commit
b6ddd180e3
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,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