aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinyu Yuan <[email protected]>2022-04-25 18:18:05 +0800
committerGreg Kroah-Hartman <[email protected]>2022-04-26 13:44:57 +0200
commit87d0e2f41b8cc2018499be4e8003fa8c09b6f2fb (patch)
tree8576bc6fbef62f38225c759bcb9665d58def63b7 /include/linux
parent7a60fa06e80596dba5381fb018f5102ae4897658 (diff)
usb: typec: ucsi: add a common function ucsi_unregister_connectors()
In error path of ucsi_init(), it will unregister all valid ucsi connectors, and similar operation also happen in ucsi_unregister(), add a common function ucsi_unregister_connectors() for two places, inside this function, if con->wq is NULL, it will break the loop, if other kind of error happen after con->wq allocated, ucsi/typec related API is safe to unregister. Also in ucsi_init(), it allocate number of (ucsi->cap.num_connectors + 1) connectors, there is one extra as the ending, ucsi_unregister_connectors() is safe to unregister all ucsi connectors according ucsi->cap.num_connectors, remove the extra one connector to save memory. Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Linyu Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions