#include <linux/version.h>
#include "linux/lin_bus.h"
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+#include <uapi/linux/sched/types.h>
+#endif
+
/* Should be in include/linux/tty.h */
#define N_SLLIN 25
/* -------------------------------- */
static void sll_setup(struct net_device *dev)
{
dev->netdev_ops = &sll_netdev_ops;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
dev->destructor = sll_free_netdev;
+#else /* Linux 4.12.0+ */
+ dev->priv_destructor = sll_free_netdev;
+#endif /* Linux 4.12.0+ */
dev->hard_header_len = 0;
dev->addr_len = 0;
if (sl->tty) {
netdev_dbg(sl->dev, "tty discipline still running\n");
/* Intentionally leak the control block. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
dev->destructor = NULL;
+#else /* Linux 4.12.0+ */
+ dev->priv_destructor = NULL;
+#endif /* Linux 4.12.0+ */
}
unregister_netdev(dev);