[PATCH v2 3/4] usb: gadget: configfs: Leave resetting the deactivation to the UDC core
From: Alexey Charkov
Date: Fri Nov 13 2026 - 07:13:09 EST
Commit bf95c4d4630c ("usb: gadget: configfs: clear deactivation flag in
configfs_composite_unbind()") made configfs reset gadget->deactivated on
unbind, so that a rebound gadget could connect again. The UDC core now
does that for every gadget driver, under connect_lock, which guards the
flag everywhere else.
Drop the unlocked write from configfs_composite_unbind().
Signed-off-by: Alexey Charkov <alchark@xxxxxxxxxxx>
---
drivers/usb/gadget/configfs.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 51df6d1d1487..c0f9e6625b64 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1849,7 +1849,6 @@ static void configfs_composite_unbind(struct usb_gadget *gadget)
spin_lock_irqsave(&gi->spinlock, flags);
cdev->gadget = NULL;
cdev->deactivations = 0;
- gadget->deactivated = false;
set_gadget_data(gadget, NULL);
spin_unlock_irqrestore(&gi->spinlock, flags);
}
--
2.56.0