ar71xx: ethernet: skip calls to netdev_completed_queue and netif_wake_queue if no...
[openwrt.git] / target / linux / ar71xx / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_main.c
index 5913bb6..8c62a4d 100644 (file)
@@ -847,6 +847,9 @@ static int ag71xx_tx_packets(struct ag71xx *ag)
 
        DBG("%s: %d packets sent out\n", ag->dev->name, sent);
 
+       if (!sent)
+               return;
+
        netdev_completed_queue(ag->dev, sent, bytes_compl);
        if ((ring->curr - ring->dirty) < (ring->size * 3) / 4)
                netif_wake_queue(ag->dev);
@@ -887,7 +890,6 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
                dma_unmap_single(&dev->dev, ring->buf[i].dma_addr,
                                 AG71XX_RX_BUF_SIZE, DMA_FROM_DEVICE);
 
-               dev->last_rx = jiffies;
                dev->stats.rx_packets++;
                dev->stats.rx_bytes += pktlen;
 
@@ -1049,6 +1051,7 @@ static int ag71xx_change_mtu(struct net_device *dev, int new_mtu)
                return -EINVAL;
 
        dev->mtu = new_mtu;
+       return 0;
 }
 
 static const struct net_device_ops ag71xx_netdev_ops = {