Commit d18291da authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] eql: use netdev_priv

Use netdev_priv where possible.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
parent 546dfb90
...@@ -164,12 +164,12 @@ static char version[] __initdata = ...@@ -164,12 +164,12 @@ static char version[] __initdata =
static void __init eql_setup(struct net_device *dev) static void __init eql_setup(struct net_device *dev)
{ {
equalizer_t *eql = dev->priv; equalizer_t *eql = netdev_priv(dev);
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
init_timer(&eql->timer); init_timer(&eql->timer);
eql->timer.data = (unsigned long) dev->priv; eql->timer.data = (unsigned long) eql;
eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL; eql->timer.expires = jiffies + EQL_DEFAULT_RESCHED_IVAL;
eql->timer.function = eql_timer; eql->timer.function = eql_timer;
...@@ -197,7 +197,7 @@ static void __init eql_setup(struct net_device *dev) ...@@ -197,7 +197,7 @@ static void __init eql_setup(struct net_device *dev)
static int eql_open(struct net_device *dev) static int eql_open(struct net_device *dev)
{ {
equalizer_t *eql = dev->priv; equalizer_t *eql = netdev_priv(dev);
/* XXX We should force this off automatically for the user. */ /* XXX We should force this off automatically for the user. */
printk(KERN_INFO "%s: remember to turn off Van-Jacobson compression on " printk(KERN_INFO "%s: remember to turn off Van-Jacobson compression on "
...@@ -241,7 +241,7 @@ static void eql_kill_slave_queue(slave_queue_t *queue) ...@@ -241,7 +241,7 @@ static void eql_kill_slave_queue(slave_queue_t *queue)
static int eql_close(struct net_device *dev) static int eql_close(struct net_device *dev)
{ {
equalizer_t *eql = dev->priv; equalizer_t *eql = netdev_priv(dev);
/* /*
* The timer has to be stopped first before we start hacking away * The timer has to be stopped first before we start hacking away
...@@ -326,7 +326,7 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue) ...@@ -326,7 +326,7 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue)
static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
equalizer_t *eql = dev->priv; equalizer_t *eql = netdev_priv(dev);
slave_t *slave; slave_t *slave;
spin_lock(&eql->queue.lock); spin_lock(&eql->queue.lock);
...@@ -352,7 +352,7 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -352,7 +352,7 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats * eql_get_stats(struct net_device *dev) static struct net_device_stats * eql_get_stats(struct net_device *dev)
{ {
equalizer_t *eql = dev->priv; equalizer_t *eql = netdev_priv(dev);
return &eql->stats; return &eql->stats;
} }
...@@ -378,7 +378,7 @@ static slave_t *__eql_find_slave_dev(slave_queue_t *queue, struct net_device *de ...@@ -378,7 +378,7 @@ static slave_t *__eql_find_slave_dev(slave_queue_t *queue, struct net_device *de
static inline int eql_is_full(slave_queue_t *queue) static inline int eql_is_full(slave_queue_t *queue)
{ {
equalizer_t *eql = queue->master_dev->priv; equalizer_t *eql = netdev_priv(queue->master_dev);
if (queue->num_slaves >= eql->max_slaves) if (queue->num_slaves >= eql->max_slaves)
return 1; return 1;
...@@ -420,7 +420,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user * ...@@ -420,7 +420,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user *
if (!eql_is_master(slave_dev) && if (!eql_is_master(slave_dev) &&
!eql_is_slave(slave_dev)) { !eql_is_slave(slave_dev)) {
slave_t *s = kmalloc(sizeof(*s), GFP_KERNEL); slave_t *s = kmalloc(sizeof(*s), GFP_KERNEL);
equalizer_t *eql = master_dev->priv; equalizer_t *eql = netdev_priv(master_dev);
int ret; int ret;
if (!s) { if (!s) {
...@@ -453,7 +453,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user * ...@@ -453,7 +453,7 @@ static int eql_enslave(struct net_device *master_dev, slaving_request_t __user *
static int eql_emancipate(struct net_device *master_dev, slaving_request_t __user *srqp) static int eql_emancipate(struct net_device *master_dev, slaving_request_t __user *srqp)
{ {
equalizer_t *eql = master_dev->priv; equalizer_t *eql = netdev_priv(master_dev);
struct net_device *slave_dev; struct net_device *slave_dev;
slaving_request_t srq; slaving_request_t srq;
int ret; int ret;
...@@ -485,7 +485,7 @@ static int eql_emancipate(struct net_device *master_dev, slaving_request_t __use ...@@ -485,7 +485,7 @@ static int eql_emancipate(struct net_device *master_dev, slaving_request_t __use
static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp) static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
{ {
equalizer_t *eql = dev->priv; equalizer_t *eql = netdev_priv(dev);
slave_t *slave; slave_t *slave;
struct net_device *slave_dev; struct net_device *slave_dev;
slave_config_t sc; slave_config_t sc;
...@@ -539,7 +539,7 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp) ...@@ -539,7 +539,7 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
if (!slave_dev) if (!slave_dev)
return ret; return ret;
eql = dev->priv; eql = netdev_priv(dev);
spin_lock_bh(&eql->queue.lock); spin_lock_bh(&eql->queue.lock);
if (eql_is_slave(slave_dev)) { if (eql_is_slave(slave_dev)) {
slave = __eql_find_slave_dev(&eql->queue, slave_dev); slave = __eql_find_slave_dev(&eql->queue, slave_dev);
...@@ -561,7 +561,7 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp) ...@@ -561,7 +561,7 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mcp)
master_config_t mc; master_config_t mc;
if (eql_is_master(dev)) { if (eql_is_master(dev)) {
eql = dev->priv; eql = netdev_priv(dev);
mc.max_slaves = eql->max_slaves; mc.max_slaves = eql->max_slaves;
mc.min_slaves = eql->min_slaves; mc.min_slaves = eql->min_slaves;
if (copy_to_user(mcp, &mc, sizeof (master_config_t))) if (copy_to_user(mcp, &mc, sizeof (master_config_t)))
...@@ -580,7 +580,7 @@ static int eql_s_master_cfg(struct net_device *dev, master_config_t __user *mcp) ...@@ -580,7 +580,7 @@ static int eql_s_master_cfg(struct net_device *dev, master_config_t __user *mcp)
return -EFAULT; return -EFAULT;
if (eql_is_master(dev)) { if (eql_is_master(dev)) {
eql = dev->priv; eql = netdev_priv(dev);
eql->max_slaves = mc.max_slaves; eql->max_slaves = mc.max_slaves;
eql->min_slaves = mc.min_slaves; eql->min_slaves = mc.min_slaves;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment