can: make use of preallocated can_ml_priv for per device struct can_dev_rcv_lists
This patch removes the old method of allocating the per device protocol specific memory via a netdevice_notifier. This had the drawback, that the allocation can fail, leading to a lot of null pointer checks in the code. This also makes the live cycle management of this memory quite complicated. This patch switches from the allocating the struct can_dev_rcv_lists in a NETDEV_REGISTER call to using the dev->ml_priv, which is allocated by the driver since the previous patch. Signed-off-by:Oleksij Rempel <o.rempel@pengutronix.de> Acked-by:
Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
Showing
- drivers/net/can/dev.c 2 additions, 0 deletionsdrivers/net/can/dev.c
- drivers/net/can/slcan.c 1 addition, 0 deletionsdrivers/net/can/slcan.c
- drivers/net/can/vcan.c 1 addition, 0 deletionsdrivers/net/can/vcan.c
- drivers/net/can/vxcan.c 1 addition, 0 deletionsdrivers/net/can/vxcan.c
- include/linux/can/can-ml.h 0 additions, 1 deletioninclude/linux/can/can-ml.h
- net/can/af_can.c 7 additions, 38 deletionsnet/can/af_can.c
Please register or sign in to comment