diff mbox series

usb: typec: Remove retimers properly

Message ID 20220825140411.10743-1-heikki.krogerus@linux.intel.com (mailing list archive)
State Accepted
Commit b7cafb8b06a05c146bf75e5f666f8d84191d1ad4
Headers show
Series usb: typec: Remove retimers properly | expand

Commit Message

Heikki Krogerus Aug. 25, 2022, 2:04 p.m. UTC
Retimer device class is left dangling when the typec module
is unloaded. Attempts to reload the module failed with warning:

        "sysfs: cannot create duplicate filename '/class/retimer'"

Fixing the issue by unregistering the class properly.

Fixes: ddaf8d96f93b ("usb: typec: Add support for retimers")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/class.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Prashant Malani Aug. 25, 2022, 5:19 p.m. UTC | #1
Hi Heikki,

Thanks for finding this.

On Aug 25 17:04, Heikki Krogerus wrote:
> Retimer device class is left dangling when the typec module
> is unloaded. Attempts to reload the module failed with warning:
> 
>         "sysfs: cannot create duplicate filename '/class/retimer'"
> 
> Fixing the issue by unregistering the class properly.
> 
> Fixes: ddaf8d96f93b ("usb: typec: Add support for retimers")
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
diff mbox series

Patch

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index ebc29ec20e3fb..bd5e5dd704313 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -2346,6 +2346,7 @@  static void __exit typec_exit(void)
 	ida_destroy(&typec_index_ida);
 	bus_unregister(&typec_bus);
 	class_unregister(&typec_mux_class);
+	class_unregister(&retimer_class);
 }
 module_exit(typec_exit);