diff mbox series

[3/4] usb: gadget: configfs: use to_config_usb_cfg() in os_desc_link()

Message ID 1637211213-16400-4-git-send-email-quic_linyyuan@quicinc.com (mailing list archive)
State Accepted
Commit 5d143ec451429891385a21617b292f2ceaa684ea
Headers show
Series usb: gadget: configfs: several cleanup change | expand

Commit Message

Linyu Yuan Nov. 18, 2021, 4:53 a.m. UTC
replace open-coded container_of() with to_config_usb_cfg() helper.

Reviewed-by: Jack Pham <quic_jackp@quicinc.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
---
 drivers/usb/gadget/configfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index ae0890a..ff0fb33 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -883,9 +883,7 @@  static int os_desc_link(struct config_item *os_desc_ci,
 {
 	struct gadget_info *gi = os_desc_item_to_gadget_info(os_desc_ci);
 	struct usb_composite_dev *cdev = &gi->cdev;
-	struct config_usb_cfg *c_target =
-		container_of(to_config_group(usb_cfg_ci),
-			     struct config_usb_cfg, group);
+	struct config_usb_cfg *c_target = to_config_usb_cfg(usb_cfg_ci);
 	struct usb_configuration *c;
 	int ret;