Merge tag 'sh-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[firefly-linux-kernel-4.4.55.git] / drivers / net / dummy.c
index bd8f84b0b894ebfe616a85b365598347d648200f..0932ffbf381b5b5c877b9988318912fcea930473 100644 (file)
@@ -63,10 +63,10 @@ static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,
 
                dstats = per_cpu_ptr(dev->dstats, i);
                do {
-                       start = u64_stats_fetch_begin_bh(&dstats->syncp);
+                       start = u64_stats_fetch_begin_irq(&dstats->syncp);
                        tbytes = dstats->tx_bytes;
                        tpackets = dstats->tx_packets;
-               } while (u64_stats_fetch_retry_bh(&dstats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&dstats->syncp, start));
                stats->tx_bytes += tbytes;
                stats->tx_packets += tpackets;
        }
@@ -88,16 +88,10 @@ static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev)
 
 static int dummy_dev_init(struct net_device *dev)
 {
-       int i;
-       dev->dstats = alloc_percpu(struct pcpu_dstats);
+       dev->dstats = netdev_alloc_pcpu_stats(struct pcpu_dstats);
        if (!dev->dstats)
                return -ENOMEM;
 
-       for_each_possible_cpu(i) {
-               struct pcpu_dstats *dstats;
-               dstats = per_cpu_ptr(dev->dstats, i);
-               u64_stats_init(&dstats->syncp);
-       }
        return 0;
 }