diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-05-26 11:39:04 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-18 22:16:21 (GMT) |
commit | 5749df14aef6d3fd7146f17e4f0c61526a53766e (patch) | |
tree | 06f558caf322e523aa2a266afd66087864dd66e4 /drivers/staging/cxt1e1/linux.c | |
parent | 41a38d9e632f7c9ec5ad8fc627567d97f4302c4a (diff) | |
download | linux-5749df14aef6d3fd7146f17e4f0c61526a53766e.tar.xz |
Staging: cxt1e1: remove all code dependent on LINUX_VERSION_CODE
Remove all code which is dead for in-kernel driver due to being
ifdefed by LINUX_VERSION_CODE.
While at it, also remove surrounding code which is commented out,
or '#if 1' nops.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/cxt1e1/linux.c')
-rw-r--r-- | drivers/staging/cxt1e1/linux.c | 123 |
1 files changed, 0 insertions, 123 deletions
diff --git a/drivers/staging/cxt1e1/linux.c b/drivers/staging/cxt1e1/linux.c index 134e756..4088347 100644 --- a/drivers/staging/cxt1e1/linux.c +++ b/drivers/staging/cxt1e1/linux.c @@ -142,10 +142,6 @@ getuserbychan (int channum) } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#define DEV_TO_PRIV(dev) ( * (struct c4_priv **) ((hdlc_device*)(dev)+1)) -#else - char * get_hdlc_name (hdlc_device * hdlc) { @@ -154,7 +150,6 @@ get_hdlc_name (hdlc_device * hdlc) return dev->name; } -#endif static status_t @@ -167,7 +162,6 @@ mkret (int bsd) } /***************************************************************************/ -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) #include <linux/workqueue.h> /*** @@ -259,7 +253,6 @@ c4_wq_port_cleanup (mpi_t * pi) pi->wq_port = 0; } } -#endif /***************************************************************************/ @@ -291,48 +284,6 @@ void_open (struct net_device * ndev) } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4) - -/** Linux 2.4.18-19 **/ -STATIC int -chan_open (hdlc_device * hdlc) -{ - status_t ret; - - if ((ret = c4_chan_up (DEV_TO_PRIV (hdlc)->ci, DEV_TO_PRIV (hdlc)->channum))) - return -ret; - MOD_INC_USE_COUNT; - netif_start_queue (hdlc_to_dev (hdlc)); - return 0; /* no error = success */ -} - -#else - -/** Linux 2.4.20 and higher **/ -STATIC int -chan_open (struct net_device * ndev) -{ - hdlc_device *hdlc = dev_to_hdlc (ndev); - status_t ret; - - hdlc->proto = IF_PROTO_HDLC; - if ((ret = hdlc_open (hdlc))) - { - pr_info("hdlc_open failure, err %d.\n", ret); - return ret; - } - if ((ret = c4_chan_up (DEV_TO_PRIV (hdlc)->ci, DEV_TO_PRIV (hdlc)->channum))) - return -ret; - MOD_INC_USE_COUNT; - netif_start_queue (hdlc_to_dev (hdlc)); - return 0; /* no error = success */ -} -#endif - -#else - -/** Linux 2.6 **/ STATIC int chan_open (struct net_device * ndev) { @@ -351,39 +302,8 @@ chan_open (struct net_device * ndev) netif_start_queue (ndev); return 0; /* no error = success */ } -#endif - - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4) - -/** Linux 2.4.18-19 **/ -STATIC void -chan_close (hdlc_device * hdlc) -{ - netif_stop_queue (hdlc_to_dev (hdlc)); - musycc_chan_down ((ci_t *) 0, DEV_TO_PRIV (hdlc)->channum); - MOD_DEC_USE_COUNT; -} -#else -/** Linux 2.4.20 and higher **/ -STATIC int -chan_close (struct net_device * ndev) -{ - hdlc_device *hdlc = dev_to_hdlc (ndev); - netif_stop_queue (hdlc_to_dev (hdlc)); - musycc_chan_down ((ci_t *) 0, DEV_TO_PRIV (hdlc)->channum); - hdlc_close (hdlc); - MOD_DEC_USE_COUNT; - return 0; -} -#endif - -#else - -/** Linux 2.6 **/ STATIC int chan_close (struct net_device * ndev) { @@ -396,7 +316,6 @@ chan_close (struct net_device * ndev) module_put (THIS_MODULE); return 0; } -#endif #if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4) @@ -435,11 +354,7 @@ chan_dev_ioctl (struct net_device * dev, struct ifreq * ifr, int cmd) STATIC int -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -chan_attach_noop (hdlc_device * hdlc, unsigned short foo_1, unsigned short foo_2) -#else chan_attach_noop (struct net_device * ndev, unsigned short foo_1, unsigned short foo_2) -#endif { return 0; /* our driver has nothing to do here, show's * over, go home */ @@ -455,16 +370,12 @@ chan_get_stats (struct net_device * ndev) struct sbecom_chan_stats *stats; int channum; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - channum = DEV_TO_PRIV (ndev)->channum; -#else { struct c4_priv *priv; priv = (struct c4_priv *) dev_to_hdlc (ndev)->priv; channum = priv->channum; } -#endif ch = c4_find_chan (channum); if (ch == NULL) @@ -527,13 +438,9 @@ c4_linux_xmit (struct sk_buff * skb, struct net_device * ndev) const struct c4_priv *priv; int rval; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - priv = DEV_TO_PRIV (ndev); -#else hdlc_device *hdlc = dev_to_hdlc (ndev); priv = hdlc->priv; -#endif rval = musycc_start_xmit (priv->ci, priv->channum, skb); return -rval; @@ -823,18 +730,10 @@ do_create_chan (struct net_device * ndev, void *data) ret = mkret (c4_new_chan (ci, cp.port, cp.channum, dev)); if (ret) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - rtnl_unlock (); /* needed due to Ioctl calling sequence */ - V7 (unregister_hdlc_device) (dev_to_hdlc (dev)); - rtnl_lock (); /* needed due to Ioctl calling sequence */ - OS_kfree (DEV_TO_PRIV (dev)); - OS_kfree (dev); -#else rtnl_unlock (); /* needed due to Ioctl calling sequence */ unregister_hdlc_device (dev); rtnl_lock (); /* needed due to Ioctl calling sequence */ free_netdev (dev); -#endif } return ret; } @@ -883,11 +782,7 @@ do_deluser (struct net_device * ndev, int lockit) const struct c4_priv *priv; int channum; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - priv = DEV_TO_PRIV (ndev); -#else priv = (struct c4_priv *) dev_to_hdlc (ndev)->priv; -#endif ci = priv->ci; channum = priv->channum; @@ -897,22 +792,12 @@ do_deluser (struct net_device * ndev, int lockit) ch->user = 0; /* will be freed, below */ } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) - if (lockit) - rtnl_unlock (); /* needed if Ioctl calling sequence */ - V7 (unregister_hdlc_device) (dev_to_hdlc (ndev)); - if (lockit) - rtnl_lock (); /* needed if Ioctl calling sequence */ - OS_kfree (DEV_TO_PRIV (ndev)); - OS_kfree (ndev); -#else if (lockit) rtnl_unlock (); /* needed if Ioctl calling sequence */ unregister_hdlc_device (ndev); if (lockit) rtnl_lock (); /* needed if Ioctl calling sequence */ free_netdev (ndev); -#endif return 0; } @@ -1339,14 +1224,6 @@ c4_mod_remove (void) module_init (c4_mod_init); module_exit (c4_mod_remove); -#ifndef SBE_INCLUDE_SYMBOLS -#ifndef CONFIG_SBE_WANC24_NCOMM -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -EXPORT_NO_SYMBOLS; -#endif -#endif -#endif - MODULE_AUTHOR ("SBE Technical Services <support@sbei.com>"); MODULE_DESCRIPTION ("wanPCI-CxT1E1 Generic HDLC WAN Driver module"); #ifdef MODULE_LICENSE |