Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 81bd2e5a authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: dwc3-msm: Ensure separate EUD extcon dev is used



USB dwc3 driver is registering for VBUS, ID, and EUD based notification
for USB cable status. VBUS and ID can be notified with same edev if
board design support that, but EUD based notification needs to come by
EUD extcon managed by EUD driver. Here in absent of EUD extcon phandler
current code is using previous VBUS related edev handler and registering
EUD related notifier callback. This results into EUD related notifier
callback being called after VBUS related notifier callback although there
is no EUD extcon change. Fix this issue by explicitly marking edev to
NULL before querying for EUD extcon.

Change-Id: I9aa8406f28165ba986d693fdf8a2e328192a68b1
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 70be28c9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2912,6 +2912,7 @@ static int dwc3_msm_extcon_register(struct dwc3_msm *mdwc)
		}
	}

	edev = NULL;
	/* Use third phandle (optional) for EUD based detach/attach events */
	if (of_count_phandle_with_args(node, "extcon", NULL) > 2) {
		edev = extcon_get_edev_by_phandle(mdwc->dev, 2);
@@ -2921,7 +2922,7 @@ static int dwc3_msm_extcon_register(struct dwc3_msm *mdwc)
		}
	}

	if (!IS_ERR(edev)) {
	if (!IS_ERR_OR_NULL(edev)) {
		mdwc->extcon_eud = edev;
		mdwc->eud_event_nb.notifier_call = dwc3_msm_eud_notifier;
		ret = extcon_register_notifier(edev, EXTCON_USB,