usb: gadget: configfs: use to_config_usb_cfg() in os_desc_link()

[ Upstream commit 5d143ec451429891385a21617b292f2ceaa684ea ]

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>
Link: https://lore.kernel.org/r/1637211213-16400-4-git-send-email-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 89e7252d6c7e ("usb: gadget: configfs: Restrict symlink creation is UDC already binded")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Linyu Yuan 2021-11-18 12:53:32 +08:00 committed by Greg Kroah-Hartman
parent f12829e513
commit c955f9cf75

View File

@ -890,9 +890,7 @@ static int os_desc_link(struct config_item *os_desc_ci,
struct gadget_info *gi = container_of(to_config_group(os_desc_ci),
struct gadget_info, os_desc_group);
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;