aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sunqe.c
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:38:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:38:36 -0500
commit8f15ea42b64941001a401cf855a0869e24f3a845 (patch)
tree27c7534ad70ebda6986491daeac0ebe0f1ca54ed /drivers/net/sunqe.c
parent4cf1653aa90c6320dc8032443b5e322820aa28b1 (diff)
netdevice: safe convert to netdev_priv() #part-3
We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sunqe.c')
-rw-r--r--drivers/net/sunqe.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 8f1e7ffb4f2a..6e8f377355fe 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -512,7 +512,7 @@ static irqreturn_t qec_interrupt(int irq, void *dev_id)
512 512
513static int qe_open(struct net_device *dev) 513static int qe_open(struct net_device *dev)
514{ 514{
515 struct sunqe *qep = (struct sunqe *) dev->priv; 515 struct sunqe *qep = netdev_priv(dev);
516 516
517 qep->mconfig = (MREGS_MCONFIG_TXENAB | 517 qep->mconfig = (MREGS_MCONFIG_TXENAB |
518 MREGS_MCONFIG_RXENAB | 518 MREGS_MCONFIG_RXENAB |
@@ -522,7 +522,7 @@ static int qe_open(struct net_device *dev)
522 522
523static int qe_close(struct net_device *dev) 523static int qe_close(struct net_device *dev)
524{ 524{
525 struct sunqe *qep = (struct sunqe *) dev->priv; 525 struct sunqe *qep = netdev_priv(dev);
526 526
527 qe_stop(qep); 527 qe_stop(qep);
528 return 0; 528 return 0;
@@ -548,7 +548,7 @@ static void qe_tx_reclaim(struct sunqe *qep)
548 548
549static void qe_tx_timeout(struct net_device *dev) 549static void qe_tx_timeout(struct net_device *dev)
550{ 550{
551 struct sunqe *qep = (struct sunqe *) dev->priv; 551 struct sunqe *qep = netdev_priv(dev);
552 int tx_full; 552 int tx_full;
553 553
554 spin_lock_irq(&qep->lock); 554 spin_lock_irq(&qep->lock);
@@ -574,7 +574,7 @@ out:
574/* Get a packet queued to go onto the wire. */ 574/* Get a packet queued to go onto the wire. */
575static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev) 575static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
576{ 576{
577 struct sunqe *qep = (struct sunqe *) dev->priv; 577 struct sunqe *qep = netdev_priv(dev);
578 struct sunqe_buffers *qbufs = qep->buffers; 578 struct sunqe_buffers *qbufs = qep->buffers;
579 __u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma; 579 __u32 txbuf_dvma, qbufs_dvma = qep->buffers_dvma;
580 unsigned char *txbuf; 580 unsigned char *txbuf;
@@ -626,7 +626,7 @@ static int qe_start_xmit(struct sk_buff *skb, struct net_device *dev)
626 626
627static void qe_set_multicast(struct net_device *dev) 627static void qe_set_multicast(struct net_device *dev)
628{ 628{
629 struct sunqe *qep = (struct sunqe *) dev->priv; 629 struct sunqe *qep = netdev_priv(dev);
630 struct dev_mc_list *dmi = dev->mc_list; 630 struct dev_mc_list *dmi = dev->mc_list;
631 u8 new_mconfig = qep->mconfig; 631 u8 new_mconfig = qep->mconfig;
632 char *addrs; 632 char *addrs;
@@ -692,7 +692,7 @@ static void qe_set_multicast(struct net_device *dev)
692static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) 692static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
693{ 693{
694 const struct linux_prom_registers *regs; 694 const struct linux_prom_registers *regs;
695 struct sunqe *qep = dev->priv; 695 struct sunqe *qep = netdev_priv(dev);
696 struct of_device *op; 696 struct of_device *op;
697 697
698 strcpy(info->driver, "sunqe"); 698 strcpy(info->driver, "sunqe");
@@ -707,7 +707,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
707 707
708static u32 qe_get_link(struct net_device *dev) 708static u32 qe_get_link(struct net_device *dev)
709{ 709{
710 struct sunqe *qep = dev->priv; 710 struct sunqe *qep = netdev_priv(dev);
711 void __iomem *mregs = qep->mregs; 711 void __iomem *mregs = qep->mregs;
712 u8 phyconfig; 712 u8 phyconfig;
713 713