[PATCH 1/3] usb: gadget: dfu: Use func_to_dfu

Jules Maselbas jmaselbas at kalray.eu
Mon Feb 8 11:34:56 EST 2021


Replace the uses of container_of with func_to_dfu when available.

Signed-off-by: Jules Maselbas <jmaselbas at kalray.eu>
---
 drivers/usb/gadget/dfu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 7e23fa315..9d6a9d252 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -181,7 +181,7 @@ dfu_bind(struct usb_configuration *c, struct usb_function *f)
 	struct usb_descriptor_header **header;
 	struct usb_interface_descriptor *desc;
 	struct file_list_entry *fentry;
-	struct f_dfu *dfu = container_of(f, struct f_dfu, func);
+	struct f_dfu *dfu = func_to_dfu(f);
 	int i;
 	int			status;
 	struct usb_string	*us;
@@ -863,7 +863,7 @@ out:
 
 static void dfu_free_func(struct usb_function *f)
 {
-	struct f_dfu *dfu = container_of(f, struct f_dfu, func);
+	struct f_dfu *dfu = func_to_dfu(f);
 
 	free(dfu);
 }
-- 
2.17.1





More information about the barebox mailing list