usb: pd: Avoid calling SVID disconnect if not previously connected
Only call an SVID handler's disconnect function only if it was
previously connected, i.e. when the state machine had proceeded
received a successful DISCOVER_SVIDs response. This helps to
avoid excessive notification to SVID clients.
While at it, require that .connect and .disconnect callbacks
are supplied during registration. This helps to eliminate NULL
checks each time they are called.
Change-Id: I030153a6b2106a6504ed51b5cb00a27f842e2488
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment