public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: core: sysfs: Unmerge @usb3_hardware_lpm_attr_group in remove_power_attributes()
@ 2024-08-14 11:07 Zijun Hu
  2024-08-14 11:47 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Zijun Hu @ 2024-08-14 11:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Kevin Strasser
  Cc: Zijun Hu, linux-usb, linux-kernel, Zijun Hu

From: Zijun Hu <quic_zijuhu@quicinc.com>

Device attribute group @usb3_hardware_lpm_attr_group is merged by
add_power_attributes(), but it is not unmerged explicitly, fixed by
unmerging it in remove_power_attributes().

Fixes: 655fe4effe0f ("usbcore: add sysfs support to xHCI usb3 hardware LPM")
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 drivers/usb/core/sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
index d83231d6736a..61b6d978892c 100644
--- a/drivers/usb/core/sysfs.c
+++ b/drivers/usb/core/sysfs.c
@@ -670,6 +670,7 @@ static int add_power_attributes(struct device *dev)
 
 static void remove_power_attributes(struct device *dev)
 {
+	sysfs_unmerge_group(&dev->kobj, &usb3_hardware_lpm_attr_group);
 	sysfs_unmerge_group(&dev->kobj, &usb2_hardware_lpm_attr_group);
 	sysfs_unmerge_group(&dev->kobj, &power_attr_group);
 }

---
base-commit: 82313624b2ae5a943d16475a566b65c873989e9f
change-id: 20240814-sysfs_fix-2206de9b0179

Best regards,
-- 
Zijun Hu <quic_zijuhu@quicinc.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-14 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 11:07 [PATCH] usb: core: sysfs: Unmerge @usb3_hardware_lpm_attr_group in remove_power_attributes() Zijun Hu
2024-08-14 11:47 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox