]> rtime.felk.cvut.cz Git - linux-lin.git/commitdiff
sllin: updates for the newer (4.12+) kernel version.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Wed, 24 Jul 2019 07:00:16 +0000 (09:00 +0200)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Wed, 24 Jul 2019 07:00:16 +0000 (09:00 +0200)
Problem reported and fix for 4.19 kernel contributed by
  Remi Verschelde <rverschelde@gmail.com>

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
sllin/sllin.c

index 2088794e4ccbeb5a779c3095e719a2e90cf71d70..5197b76cfb4d4192054ea8f5d5f7df7927c7db6d 100644 (file)
 #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
 /* -------------------------------- */
@@ -616,7 +620,11 @@ static const struct net_device_ops sll_netdev_ops = {
 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;
@@ -1822,7 +1830,11 @@ static void __exit sllin_exit(void)
                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);