# Re: \[PATCH 4/6\] can: etas\_es58x: add es58x\_free\_netdevs() to factorize code

- From: Marc Kleine-Budde \<mkl@pengutronix.de\>
- Date: 2021-07-24 21:23:05 
- List: linux-can
- Page: https://ratatoskr.run/linux-can/2021/07/9356429
- Thread: https://ratatoskr.run/linux-can/2021/06/9356331/t.md

```text
On 29.06.2021 00:54:18, Vincent Mailhol wrote:
> Both es58x_probe() and es58x_disconnect() use a similar code snippet
> to release the netdev resources. Factorize it in an helper function
> named es58x_free_netdevs().
> 
> Signed-off-by: Vincent Mailhol <redacted>
> ---
>  drivers/net/can/usb/etas_es58x/es58x_core.c | 46 +++++++++++----------
>  1 file changed, 24 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
> index d2bb1b56f962..dbc4f75336a1 100644
> --- a/drivers/net/can/usb/etas_es58x/es58x_core.c
> +++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
> @@ -2107,6 +2107,25 @@ static int es58x_init_netdev(struct es58x_device *es58x_dev, int channel_idx)
>  	return ret;
>  }
>  
> +/**
> + * es58x_free_netdevs() - Release all network resorces of the device.
                                                 ^^^^^^^^
fixed typo

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-can/2021/07/9356429/attachment/0) (application/pgp-signature, 488 bytes)
