Revert "usb: typec: class: Invalidate USB device pointers on partner unregistration"

This reverts commit 40966fc993 which is
commit 66e1a887273c6b89f09bc11a40d0a71d5a081a8e upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Icc0eb6a1b0cb641a7ffe8b910d41482e30cb4ac4
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-05-21 14:41:00 +00:00
parent f382226159
commit 9bc73ad3e8

View File

@@ -966,14 +966,10 @@ void typec_unregister_partner(struct typec_partner *partner)
port = to_typec_port(partner->dev.parent);
mutex_lock(&port->partner_link_lock);
if (port->usb2_dev) {
if (port->usb2_dev)
typec_partner_unlink_device(partner, port->usb2_dev);
port->usb2_dev = NULL;
}
if (port->usb3_dev) {
if (port->usb3_dev)
typec_partner_unlink_device(partner, port->usb3_dev);
port->usb3_dev = NULL;
}
device_unregister(&partner->dev);
mutex_unlock(&port->partner_link_lock);