# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1431006822 -7200
# Node ID 827abf3c50de5d7d523f7bcfa5ed5e50b4f1b130
# Parent  792892ab4806a91e2103fda31dd69f06369b1de7
New alloc_netdev() API since kernel 3.17.

diff -r 792892ab4806 -r 827abf3c50de devices/generic.c
--- a/devices/generic.c	Tue Oct 28 16:54:59 2014 +0100
+++ b/devices/generic.c	Thu May 07 15:53:42 2015 +0200
@@ -149,7 +149,12 @@
     dev->socket = NULL;
     dev->rx_buf = NULL;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
+    dev->netdev = alloc_netdev(sizeof(ec_gen_device_t *), &null,
+            NET_NAME_UNKNOWN, ether_setup);
+#else
     dev->netdev = alloc_netdev(sizeof(ec_gen_device_t *), &null, ether_setup);
+#endif
     if (!dev->netdev) {
         return -ENOMEM;
     }
diff -r 792892ab4806 -r 827abf3c50de master/ethernet.c
--- a/master/ethernet.c	Tue Oct 28 16:54:59 2014 +0100
+++ b/master/ethernet.c	Thu May 07 15:53:42 2015 +0200
@@ -148,7 +148,13 @@
 
     snprintf(eoe->datagram.name, EC_DATAGRAM_NAME_SIZE, name);
 
-    if (!(eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, ether_setup))) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
+    eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, NET_NAME_UNKNOWN,
+            ether_setup);
+#else
+    eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, ether_setup);
+#endif
+    if (!eoe->dev) {
         EC_SLAVE_ERR(slave, "Unable to allocate net_device %s"
                 " for EoE handler!\n", name);
         ret = -ENODEV;