usb: pd: Don't notify EXTCON_USB unless type is SDP or CDP

commit 77f6fd8044 ("usb: pd: Add support to notify plug
orientation via extcon") added an additional extcon notifier
to indicate orientation. But for the PE_SNK_STARTUP case
the change inadvertently notifies EXTCON_USB for all sink
states when it should just be for psy_type==USB|USB_CDP.
Add the missing curly braces to the if statement.

Change-Id: I19d424ff0d46cc0134210424a7d431b331cbf963
Signed-off-by: Jack Pham <jackp@codeaurora.org>
This commit is contained in:
Jack Pham 2016-07-20 09:51:33 -07:00
parent 7eb20e5733
commit f33cac01f3

View file

@ -669,12 +669,13 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)
pd->current_dr = DR_UFP;
if (pd->psy_type == POWER_SUPPLY_TYPE_USB ||
pd->psy_type == POWER_SUPPLY_TYPE_USB_CDP)
pd->psy_type == POWER_SUPPLY_TYPE_USB_CDP) {
extcon_set_cable_state_(pd->extcon,
EXTCON_USB_CC,
is_cable_flipped(pd));
extcon_set_cable_state_(pd->extcon,
EXTCON_USB, 1);
}
}
pd->rx_msg_len = 0;