Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
usb: roles: don't get/set_role() when usb_role_switch is unregistered
There is a possibility that usb_role_switch device is unregistered before the user put usb_role_switch. In this case, the user may still want to get/set_role() since the user can't sense the changes of usb_role_switch. This will add a flag to show if usb_role_switch is already registered and avoid unwanted behaviors. Fixes: fde0aa6 ("usb: common: Small class for USB role switches") cc: [email protected] Signed-off-by: Xu Yang <[email protected]> Acked-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information