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

Commit edbf38ed authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: pd: Avoid dual_role_instance_changed() if nothing changed"

parents b71f5ce7 d8aa0fd5
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1499,6 +1499,9 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)
				!pd->in_explicit_contract)
			stop_usb_host(pd);

		if (!pd->in_explicit_contract)
			dual_role_instance_changed(pd->dual_role);

		pd->in_explicit_contract = true;

		if (pd->vdm_tx && !pd->sm_queued)
@@ -1512,7 +1515,6 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)

		kobject_uevent(&pd->dev.kobj, KOBJ_CHANGE);
		complete(&pd->is_ready);
		dual_role_instance_changed(pd->dual_role);
		break;

	case PE_PRS_SRC_SNK_TRANSITION_TO_OFF:
@@ -1687,6 +1689,9 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)
		break;

	case PE_SNK_READY:
		if (!pd->in_explicit_contract)
			dual_role_instance_changed(pd->dual_role);

		pd->in_explicit_contract = true;

		if (pd->vdm_tx)
@@ -1698,7 +1703,6 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)

		kobject_uevent(&pd->dev.kobj, KOBJ_CHANGE);
		complete(&pd->is_ready);
		dual_role_instance_changed(pd->dual_role);
		break;

	case PE_SNK_TRANSITION_TO_DEFAULT: