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

Sascha Hauer s.hauer at pengutronix.de
Wed Feb 10 04:44:47 EST 2021


On Mon, Feb 08, 2021 at 05:34:56PM +0100, Jules Maselbas wrote:
> 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(-)

Applied, thanks

Sascha

> 
> 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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list