diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-20 04:02:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-20 04:02:05 -0500 |
commit | f4bdd264b43cc60dccb617afce2859dffdd7a935 (patch) | |
tree | 26cb9d386b1f1fa1a2902ee9943b71dee7423f9a /drivers/net/hamradio | |
parent | f3a216d1da1c034c425c4eafe27a1b45269985c7 (diff) |
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: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hamradio')
-rw-r--r-- | drivers/net/hamradio/dmascc.c | 12 | ||||
-rw-r--r-- | drivers/net/hamradio/scc.c | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 7e461144223..e67103396ed 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -572,7 +572,7 @@ static int __init setup_adapter(int card_base, int type, int n) | |||
572 | priv->param.persist = 256; | 572 | priv->param.persist = 256; |
573 | priv->param.dma = -1; | 573 | priv->param.dma = -1; |
574 | INIT_WORK(&priv->rx_work, rx_bh); | 574 | INIT_WORK(&priv->rx_work, rx_bh); |
575 | dev->priv = priv; | 575 | dev->ml_priv = priv; |
576 | sprintf(dev->name, "dmascc%i", 2 * n + i); | 576 | sprintf(dev->name, "dmascc%i", 2 * n + i); |
577 | dev->base_addr = card_base; | 577 | dev->base_addr = card_base; |
578 | dev->irq = irq; | 578 | dev->irq = irq; |
@@ -720,7 +720,7 @@ static int read_scc_data(struct scc_priv *priv) | |||
720 | 720 | ||
721 | static int scc_open(struct net_device *dev) | 721 | static int scc_open(struct net_device *dev) |
722 | { | 722 | { |
723 | struct scc_priv *priv = dev->priv; | 723 | struct scc_priv *priv = dev->ml_priv; |
724 | struct scc_info *info = priv->info; | 724 | struct scc_info *info = priv->info; |
725 | int card_base = priv->card_base; | 725 | int card_base = priv->card_base; |
726 | 726 | ||
@@ -862,7 +862,7 @@ static int scc_open(struct net_device *dev) | |||
862 | 862 | ||
863 | static int scc_close(struct net_device *dev) | 863 | static int scc_close(struct net_device *dev) |
864 | { | 864 | { |
865 | struct scc_priv *priv = dev->priv; | 865 | struct scc_priv *priv = dev->ml_priv; |
866 | struct scc_info *info = priv->info; | 866 | struct scc_info *info = priv->info; |
867 | int card_base = priv->card_base; | 867 | int card_base = priv->card_base; |
868 | 868 | ||
@@ -891,7 +891,7 @@ static int scc_close(struct net_device *dev) | |||
891 | 891 | ||
892 | static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 892 | static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
893 | { | 893 | { |
894 | struct scc_priv *priv = dev->priv; | 894 | struct scc_priv *priv = dev->ml_priv; |
895 | 895 | ||
896 | switch (cmd) { | 896 | switch (cmd) { |
897 | case SIOCGSCCPARAM: | 897 | case SIOCGSCCPARAM: |
@@ -918,7 +918,7 @@ static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
918 | 918 | ||
919 | static int scc_send_packet(struct sk_buff *skb, struct net_device *dev) | 919 | static int scc_send_packet(struct sk_buff *skb, struct net_device *dev) |
920 | { | 920 | { |
921 | struct scc_priv *priv = dev->priv; | 921 | struct scc_priv *priv = dev->ml_priv; |
922 | unsigned long flags; | 922 | unsigned long flags; |
923 | int i; | 923 | int i; |
924 | 924 | ||
@@ -963,7 +963,7 @@ static int scc_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
963 | 963 | ||
964 | static struct net_device_stats *scc_get_stats(struct net_device *dev) | 964 | static struct net_device_stats *scc_get_stats(struct net_device *dev) |
965 | { | 965 | { |
966 | struct scc_priv *priv = dev->priv; | 966 | struct scc_priv *priv = dev->ml_priv; |
967 | 967 | ||
968 | return &priv->stats; | 968 | return &priv->stats; |
969 | } | 969 | } |
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index 802d1c7c4af..c011af7088e 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c | |||
@@ -1518,7 +1518,7 @@ static int scc_net_alloc(const char *name, struct scc_channel *scc) | |||
1518 | if (!dev) | 1518 | if (!dev) |
1519 | return -ENOMEM; | 1519 | return -ENOMEM; |
1520 | 1520 | ||
1521 | dev->priv = scc; | 1521 | dev->ml_priv = scc; |
1522 | scc->dev = dev; | 1522 | scc->dev = dev; |
1523 | spin_lock_init(&scc->lock); | 1523 | spin_lock_init(&scc->lock); |
1524 | init_timer(&scc->tx_t); | 1524 | init_timer(&scc->tx_t); |
@@ -1575,7 +1575,7 @@ static void scc_net_setup(struct net_device *dev) | |||
1575 | 1575 | ||
1576 | static int scc_net_open(struct net_device *dev) | 1576 | static int scc_net_open(struct net_device *dev) |
1577 | { | 1577 | { |
1578 | struct scc_channel *scc = (struct scc_channel *) dev->priv; | 1578 | struct scc_channel *scc = (struct scc_channel *) dev->ml_priv; |
1579 | 1579 | ||
1580 | if (!scc->init) | 1580 | if (!scc->init) |
1581 | return -EINVAL; | 1581 | return -EINVAL; |
@@ -1593,7 +1593,7 @@ static int scc_net_open(struct net_device *dev) | |||
1593 | 1593 | ||
1594 | static int scc_net_close(struct net_device *dev) | 1594 | static int scc_net_close(struct net_device *dev) |
1595 | { | 1595 | { |
1596 | struct scc_channel *scc = (struct scc_channel *) dev->priv; | 1596 | struct scc_channel *scc = (struct scc_channel *) dev->ml_priv; |
1597 | unsigned long flags; | 1597 | unsigned long flags; |
1598 | 1598 | ||
1599 | netif_stop_queue(dev); | 1599 | netif_stop_queue(dev); |
@@ -1634,7 +1634,7 @@ static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb) | |||
1634 | 1634 | ||
1635 | static int scc_net_tx(struct sk_buff *skb, struct net_device *dev) | 1635 | static int scc_net_tx(struct sk_buff *skb, struct net_device *dev) |
1636 | { | 1636 | { |
1637 | struct scc_channel *scc = (struct scc_channel *) dev->priv; | 1637 | struct scc_channel *scc = (struct scc_channel *) dev->ml_priv; |
1638 | unsigned long flags; | 1638 | unsigned long flags; |
1639 | char kisscmd; | 1639 | char kisscmd; |
1640 | 1640 | ||
@@ -1704,7 +1704,7 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1704 | struct scc_mem_config memcfg; | 1704 | struct scc_mem_config memcfg; |
1705 | struct scc_hw_config hwcfg; | 1705 | struct scc_hw_config hwcfg; |
1706 | struct scc_calibrate cal; | 1706 | struct scc_calibrate cal; |
1707 | struct scc_channel *scc = (struct scc_channel *) dev->priv; | 1707 | struct scc_channel *scc = (struct scc_channel *) dev->ml_priv; |
1708 | int chan; | 1708 | int chan; |
1709 | unsigned char device_name[IFNAMSIZ]; | 1709 | unsigned char device_name[IFNAMSIZ]; |
1710 | void __user *arg = ifr->ifr_data; | 1710 | void __user *arg = ifr->ifr_data; |
@@ -1951,7 +1951,7 @@ static int scc_net_set_mac_address(struct net_device *dev, void *addr) | |||
1951 | 1951 | ||
1952 | static struct net_device_stats *scc_net_get_stats(struct net_device *dev) | 1952 | static struct net_device_stats *scc_net_get_stats(struct net_device *dev) |
1953 | { | 1953 | { |
1954 | struct scc_channel *scc = (struct scc_channel *) dev->priv; | 1954 | struct scc_channel *scc = (struct scc_channel *) dev->ml_priv; |
1955 | 1955 | ||
1956 | scc->dev_stat.rx_errors = scc->stat.rxerrs + scc->stat.rx_over; | 1956 | scc->dev_stat.rx_errors = scc->stat.rxerrs + scc->stat.rx_over; |
1957 | scc->dev_stat.tx_errors = scc->stat.txerrs + scc->stat.tx_under; | 1957 | scc->dev_stat.tx_errors = scc->stat.txerrs + scc->stat.tx_under; |