Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[linux-2.6-block.git] / drivers / net / ethernet / marvell / mvneta.c
index f418f4f20f94a0f22524a6d5c1c878c2a40f7146..f3afcbdbb725c3d055a2ce10734cea17ab11ca64 100644 (file)
@@ -508,12 +508,12 @@ struct rtnl_link_stats64 *mvneta_get_stats64(struct net_device *dev,
 
                cpu_stats = per_cpu_ptr(pp->stats, cpu);
                do {
-                       start = u64_stats_fetch_begin_bh(&cpu_stats->syncp);
+                       start = u64_stats_fetch_begin_irq(&cpu_stats->syncp);
                        rx_packets = cpu_stats->rx_packets;
                        rx_bytes   = cpu_stats->rx_bytes;
                        tx_packets = cpu_stats->tx_packets;
                        tx_bytes   = cpu_stats->tx_bytes;
-               } while (u64_stats_fetch_retry_bh(&cpu_stats->syncp, start));
+               } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start));
 
                stats->rx_packets += rx_packets;
                stats->rx_bytes   += rx_bytes;
@@ -2784,7 +2784,6 @@ static int mvneta_probe(struct platform_device *pdev)
        const char *mac_from;
        int phy_mode;
        int err;
-       int cpu;
 
        /* Our multiqueue support is not complete, so for now, only
         * allow the usage of the first RX queue
@@ -2845,18 +2844,12 @@ static int mvneta_probe(struct platform_device *pdev)
        }
 
        /* Alloc per-cpu stats */
-       pp->stats = alloc_percpu(struct mvneta_pcpu_stats);
+       pp->stats = netdev_alloc_pcpu_stats(struct mvneta_pcpu_stats);
        if (!pp->stats) {
                err = -ENOMEM;
                goto err_unmap;
        }
 
-       for_each_possible_cpu(cpu) {
-               struct mvneta_pcpu_stats *stats;
-               stats = per_cpu_ptr(pp->stats, cpu);
-               u64_stats_init(&stats->syncp);
-       }
-
        dt_mac_addr = of_get_mac_address(dn);
        if (dt_mac_addr) {
                mac_from = "device tree";