Commit ec6d2d45 authored by Florian Fainelli's avatar Florian Fainelli Committed by Francois Romieu

r6040: cleanups

- use netdev_alloc_skb
- remove an useless variable in the IRQ handler
- remove an unused private structure member
- fix a spelling mistake
Signed-off-by: default avatarFlorian Fainelli <florian.fainelli@telecomint.eu>
Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
parent 106adf3c
...@@ -173,7 +173,6 @@ struct r6040_private { ...@@ -173,7 +173,6 @@ struct r6040_private {
struct net_device *dev; struct net_device *dev;
struct mii_if_info mii_if; struct mii_if_info mii_if;
struct napi_struct napi; struct napi_struct napi;
u16 napi_rx_running;
void __iomem *base; void __iomem *base;
}; };
...@@ -290,7 +289,7 @@ static void rx_buf_alloc(struct r6040_private *lp, struct net_device *dev) ...@@ -290,7 +289,7 @@ static void rx_buf_alloc(struct r6040_private *lp, struct net_device *dev)
descptr = lp->rx_insert_ptr; descptr = lp->rx_insert_ptr;
while (lp->rx_free_desc < RX_DCNT) { while (lp->rx_free_desc < RX_DCNT) {
descptr->skb_ptr = dev_alloc_skb(MAX_BUF_SIZE); descptr->skb_ptr = netdev_alloc_skb(dev, MAX_BUF_SIZE);
if (!descptr->skb_ptr) if (!descptr->skb_ptr)
break; break;
...@@ -584,7 +583,7 @@ static void r6040_tx(struct net_device *dev) ...@@ -584,7 +583,7 @@ static void r6040_tx(struct net_device *dev)
dev->stats.tx_carrier_errors++; dev->stats.tx_carrier_errors++;
if (descptr->status & 0x8000) if (descptr->status & 0x8000)
break; /* Not complte */ break; /* Not complete */
skb_ptr = descptr->skb_ptr; skb_ptr = descptr->skb_ptr;
pci_unmap_single(priv->pdev, descptr->buf, pci_unmap_single(priv->pdev, descptr->buf,
skb_ptr->len, PCI_DMA_TODEVICE); skb_ptr->len, PCI_DMA_TODEVICE);
...@@ -627,7 +626,6 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) ...@@ -627,7 +626,6 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
struct r6040_private *lp = netdev_priv(dev); struct r6040_private *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base; void __iomem *ioaddr = lp->base;
u16 status; u16 status;
int handled = 1;
/* Mask off RDC MAC interrupt */ /* Mask off RDC MAC interrupt */
iowrite16(MSK_INT, ioaddr + MIER); iowrite16(MSK_INT, ioaddr + MIER);
...@@ -647,7 +645,7 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) ...@@ -647,7 +645,7 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
if (status & 0x10) if (status & 0x10)
r6040_tx(dev); r6040_tx(dev);
return IRQ_RETVAL(handled); return IRQ_HANDLED;
} }
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
......
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