- don't use compat.h in the mainline driver stable-1.5
authorPatrick Bruenn <p.bruenn@beckhoff.com>
Thu, 05 Jun 2014 16:40:01 +0200
branchstable-1.5
changeset 2570 144e11d93e99
parent 2569 720172a7563f
child 2571 a4fdad543554
- don't use compat.h in the mainline driver
- correct constness of function pointer declarations
devices/ccat/module.c
devices/ccat/module.h
devices/ccat/netdev.c
devices/ccat/update.c
--- a/devices/ccat/module.c	Thu Jun 05 16:30:22 2014 +0200
+++ b/devices/ccat/module.c	Thu Jun 05 16:40:01 2014 +0200
@@ -22,7 +22,6 @@
 #include <linux/etherdevice.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
-#include "compat.h"
 #include "module.h"
 #include "netdev.h"
 #include "update.h"
--- a/devices/ccat/module.h	Thu Jun 05 16:30:22 2014 +0200
+++ b/devices/ccat/module.h	Thu Jun 05 16:40:01 2014 +0200
@@ -200,15 +200,15 @@
 	atomic64_t tx_bytes;
 	atomic64_t tx_dropped;
 	ec_device_t *ecdev;
-	void (*carrier_off) (struct net_device * const netdev);
-	bool (*carrier_ok) (struct net_device *const netdev);
-	void (*carrier_on) (struct net_device * const netdev);
+	void (*carrier_off) (struct net_device * netdev);
+	bool (*carrier_ok) (const struct net_device * netdev);
+	void (*carrier_on) (struct net_device * netdev);
 	void (*kfree_skb_any) (struct sk_buff * skb);
-	void (*start_queue) (struct net_device * const netdev);
-	void (*stop_queue) (struct net_device * const netdev);
-	void (*tx_fifo_full) (struct ccat_eth_priv * const priv,
-			      const struct ccat_eth_frame * const frame);
-	void (*unregister) (struct net_device * const netdev);
+	void (*start_queue) (struct net_device * netdev);
+	void (*stop_queue) (struct net_device * netdev);
+	void (*tx_fifo_full) (struct ccat_eth_priv * priv,
+			      const struct ccat_eth_frame * frame);
+	void (*unregister) (struct net_device * netdev);
 };
 
 /**
--- a/devices/ccat/netdev.c	Thu Jun 05 16:30:22 2014 +0200
+++ b/devices/ccat/netdev.c	Thu Jun 05 16:40:01 2014 +0200
@@ -25,7 +25,6 @@
 #include <linux/netdevice.h>
 #include <linux/spinlock.h>
 
-#include "compat.h"
 #include "module.h"
 #include "netdev.h"
 
@@ -50,10 +49,8 @@
 static void ec_poll(struct net_device *dev);
 static enum hrtimer_restart poll_timer_callback(struct hrtimer *timer);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
 static struct rtnl_link_stats64 *ccat_eth_get_stats64(struct net_device *dev, struct rtnl_link_stats64
 						      *storage);
-#endif
 static int ccat_eth_open(struct net_device *dev);
 static netdev_tx_t ccat_eth_start_xmit(struct sk_buff *skb,
 				       struct net_device *dev);
@@ -62,9 +59,7 @@
 			      size_t len);
 
 static const struct net_device_ops ccat_eth_netdev_ops = {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
 	.ndo_get_stats64 = ccat_eth_get_stats64,
-#endif
 	.ndo_open = ccat_eth_open,
 	.ndo_start_xmit = ccat_eth_start_xmit,
 	.ndo_stop = ccat_eth_stop,
@@ -75,7 +70,7 @@
 	/* never release a skb in EtherCAT mode */
 }
 
-static bool ecdev_carrier_ok(struct net_device *const netdev)
+static bool ecdev_carrier_ok(const struct net_device *const netdev)
 {
 	struct ccat_eth_priv *const priv = netdev_priv(netdev);
 	return ecdev_get_link(priv->ecdev);
@@ -242,7 +237,6 @@
 	return (1 << 24) == (ioread32(priv->reg.mii + 0x8 + 4) & (1 << 24));
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
 static struct rtnl_link_stats64 *ccat_eth_get_stats64(struct net_device *dev, struct rtnl_link_stats64
 						      *storage)
 {
@@ -281,7 +275,6 @@
 	//TODO __u64    tx_compressed;
 	return storage;
 }
-#endif
 
 struct ccat_eth_priv *ccat_eth_init(const struct ccat_device *const ccatdev,
 				    const void __iomem * const addr)
--- a/devices/ccat/update.c	Thu Jun 05 16:30:22 2014 +0200
+++ b/devices/ccat/update.c	Thu Jun 05 16:40:01 2014 +0200
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/uaccess.h>
-#include "compat.h"
 #include "module.h"
 #include "update.h"