From: Linyu Yuan quic_linyyuan@quicinc.com
[ Upstream commit 5284acccc4a501f38dbeceabaa0340401c107654 ]
replace open-coded container_of() with to_usb_function_instance() 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-5-git-send-email-quic_linyyuan@qu... 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 --- drivers/usb/gadget/configfs.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 7d3b93dc154fe..8166e771e8663 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -416,9 +416,8 @@ static int config_usb_cfg_link( struct usb_composite_dev *cdev = cfg->c.cdev; struct gadget_info *gi = container_of(cdev, struct gadget_info, cdev);
- struct config_group *group = to_config_group(usb_func_ci); - struct usb_function_instance *fi = container_of(group, - struct usb_function_instance, group); + struct usb_function_instance *fi = + to_usb_function_instance(usb_func_ci); struct usb_function_instance *a_fi; struct usb_function *f; int ret; @@ -467,9 +466,8 @@ static void config_usb_cfg_unlink( struct usb_composite_dev *cdev = cfg->c.cdev; struct gadget_info *gi = container_of(cdev, struct gadget_info, cdev);
- struct config_group *group = to_config_group(usb_func_ci); - struct usb_function_instance *fi = container_of(group, - struct usb_function_instance, group); + struct usb_function_instance *fi = + to_usb_function_instance(usb_func_ci); struct usb_function *f;
/*