Unverified Commit 73cf1978 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!15134 usb: typec: altmode should keep reference to parent

parents c72878be e89f4a68
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -430,6 +430,7 @@ static void typec_altmode_release(struct device *dev)
		typec_altmode_put_partner(alt);

	altmode_id_remove(alt->adev.dev.parent, alt->id);
	put_device(alt->adev.dev.parent);
	kfree(alt);
}

@@ -479,6 +480,8 @@ typec_register_altmode(struct device *parent,
	alt->adev.dev.type = &typec_altmode_dev_type;
	dev_set_name(&alt->adev.dev, "%s.%u", dev_name(parent), id);

	get_device(alt->adev.dev.parent);

	/* Link partners and plugs with the ports */
	if (!is_port)
		typec_altmode_set_partner(alt);