Commit f4bdd264 authored by Wang Chen's avatar Wang Chen Committed by David S. Miller

netdevice hamradio: Convert directly reference of netdev->priv

Since all the memory, which pointed by netdev->priv, are allocated in
advance instead of by alloc_netdev().  Use netdev->ml_priv to point to
those memory.
Signed-off-by: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f3a216d1
...@@ -572,7 +572,7 @@ static int __init setup_adapter(int card_base, int type, int n) ...@@ -572,7 +572,7 @@ static int __init setup_adapter(int card_base, int type, int n)
priv->param.persist = 256; priv->param.persist = 256;
priv->param.dma = -1; priv->param.dma = -1;
INIT_WORK(&priv->rx_work, rx_bh); INIT_WORK(&priv->rx_work, rx_bh);
dev->priv = priv; dev->ml_priv = priv;
sprintf(dev->name, "dmascc%i", 2 * n + i); sprintf(dev->name, "dmascc%i", 2 * n + i);
dev->base_addr = card_base; dev->base_addr = card_base;
dev->irq = irq; dev->irq = irq;
...@@ -720,7 +720,7 @@ static int read_scc_data(struct scc_priv *priv) ...@@ -720,7 +720,7 @@ static int read_scc_data(struct scc_priv *priv)
static int scc_open(struct net_device *dev) static int scc_open(struct net_device *dev)
{ {
struct scc_priv *priv = dev->priv; struct scc_priv *priv = dev->ml_priv;
struct scc_info *info = priv->info; struct scc_info *info = priv->info;
int card_base = priv->card_base; int card_base = priv->card_base;
...@@ -862,7 +862,7 @@ static int scc_open(struct net_device *dev) ...@@ -862,7 +862,7 @@ static int scc_open(struct net_device *dev)
static int scc_close(struct net_device *dev) static int scc_close(struct net_device *dev)
{ {
struct scc_priv *priv = dev->priv; struct scc_priv *priv = dev->ml_priv;
struct scc_info *info = priv->info; struct scc_info *info = priv->info;
int card_base = priv->card_base; int card_base = priv->card_base;
...@@ -891,7 +891,7 @@ static int scc_close(struct net_device *dev) ...@@ -891,7 +891,7 @@ static int scc_close(struct net_device *dev)
static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ {
struct scc_priv *priv = dev->priv; struct scc_priv *priv = dev->ml_priv;
switch (cmd) { switch (cmd) {
case SIOCGSCCPARAM: case SIOCGSCCPARAM:
...@@ -918,7 +918,7 @@ static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -918,7 +918,7 @@ static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static int scc_send_packet(struct sk_buff *skb, struct net_device *dev) static int scc_send_packet(struct sk_buff *skb, struct net_device *dev)
{ {
struct scc_priv *priv = dev->priv; struct scc_priv *priv = dev->ml_priv;
unsigned long flags; unsigned long flags;
int i; int i;
...@@ -963,7 +963,7 @@ static int scc_send_packet(struct sk_buff *skb, struct net_device *dev) ...@@ -963,7 +963,7 @@ static int scc_send_packet(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats *scc_get_stats(struct net_device *dev) static struct net_device_stats *scc_get_stats(struct net_device *dev)
{ {
struct scc_priv *priv = dev->priv; struct scc_priv *priv = dev->ml_priv;
return &priv->stats; return &priv->stats;
} }
......
...@@ -1518,7 +1518,7 @@ static int scc_net_alloc(const char *name, struct scc_channel *scc) ...@@ -1518,7 +1518,7 @@ static int scc_net_alloc(const char *name, struct scc_channel *scc)
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
dev->priv = scc; dev->ml_priv = scc;
scc->dev = dev; scc->dev = dev;
spin_lock_init(&scc->lock); spin_lock_init(&scc->lock);
init_timer(&scc->tx_t); init_timer(&scc->tx_t);
...@@ -1575,7 +1575,7 @@ static void scc_net_setup(struct net_device *dev) ...@@ -1575,7 +1575,7 @@ static void scc_net_setup(struct net_device *dev)
static int scc_net_open(struct net_device *dev) static int scc_net_open(struct net_device *dev)
{ {
struct scc_channel *scc = (struct scc_channel *) dev->priv; struct scc_channel *scc = (struct scc_channel *) dev->ml_priv;
if (!scc->init) if (!scc->init)
return -EINVAL; return -EINVAL;
...@@ -1593,7 +1593,7 @@ static int scc_net_open(struct net_device *dev) ...@@ -1593,7 +1593,7 @@ static int scc_net_open(struct net_device *dev)
static int scc_net_close(struct net_device *dev) static int scc_net_close(struct net_device *dev)
{ {
struct scc_channel *scc = (struct scc_channel *) dev->priv; struct scc_channel *scc = (struct scc_channel *) dev->ml_priv;
unsigned long flags; unsigned long flags;
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -1634,7 +1634,7 @@ static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb) ...@@ -1634,7 +1634,7 @@ static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb)
static int scc_net_tx(struct sk_buff *skb, struct net_device *dev) static int scc_net_tx(struct sk_buff *skb, struct net_device *dev)
{ {
struct scc_channel *scc = (struct scc_channel *) dev->priv; struct scc_channel *scc = (struct scc_channel *) dev->ml_priv;
unsigned long flags; unsigned long flags;
char kisscmd; char kisscmd;
...@@ -1704,7 +1704,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1704,7 +1704,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
struct scc_mem_config memcfg; struct scc_mem_config memcfg;
struct scc_hw_config hwcfg; struct scc_hw_config hwcfg;
struct scc_calibrate cal; struct scc_calibrate cal;
struct scc_channel *scc = (struct scc_channel *) dev->priv; struct scc_channel *scc = (struct scc_channel *) dev->ml_priv;
int chan; int chan;
unsigned char device_name[IFNAMSIZ]; unsigned char device_name[IFNAMSIZ];
void __user *arg = ifr->ifr_data; void __user *arg = ifr->ifr_data;
...@@ -1951,7 +1951,7 @@ static int scc_net_set_mac_address(struct net_device *dev, void *addr) ...@@ -1951,7 +1951,7 @@ static int scc_net_set_mac_address(struct net_device *dev, void *addr)
static struct net_device_stats *scc_net_get_stats(struct net_device *dev) static struct net_device_stats *scc_net_get_stats(struct net_device *dev)
{ {
struct scc_channel *scc = (struct scc_channel *) dev->priv; struct scc_channel *scc = (struct scc_channel *) dev->ml_priv;
scc->dev_stat.rx_errors = scc->stat.rxerrs + scc->stat.rx_over; scc->dev_stat.rx_errors = scc->stat.rxerrs + scc->stat.rx_over;
scc->dev_stat.tx_errors = scc->stat.txerrs + scc->stat.tx_under; scc->dev_stat.tx_errors = scc->stat.txerrs + scc->stat.tx_under;
......
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