]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/myri10ge/myri10ge.c
myri10ge: Use netif_set_real_num_{rx, tx}_queues()
[mv-sheeva.git] / drivers / net / myri10ge / myri10ge.c
index fb2c0927d3ccd76135d069f29971f238886b0f5a..3ad1a21ca8ce04fdc3fe0f98f796670d8e39dc29 100644 (file)
@@ -990,7 +990,7 @@ static int myri10ge_reset(struct myri10ge_priv *mgp)
                 * RX queues, so if we get an error, first retry using a
                 * single TX queue before giving up */
                if (status != 0 && mgp->dev->real_num_tx_queues > 1) {
-                       mgp->dev->real_num_tx_queues = 1;
+                       netif_set_real_num_tx_queues(mgp->dev, 1);
                        cmd.data0 = mgp->num_slices;
                        cmd.data1 = MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE;
                        status = myri10ge_send_cmd(mgp,
@@ -1555,12 +1555,12 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
         * valid  since MSI-X irqs are not shared */
        if ((mgp->dev->real_num_tx_queues == 1) && (ss != mgp->ss)) {
                napi_schedule(&ss->napi);
-               return (IRQ_HANDLED);
+               return IRQ_HANDLED;
        }
 
        /* make sure it is our IRQ, and that the DMA has finished */
        if (unlikely(!stats->valid))
-               return (IRQ_NONE);
+               return IRQ_NONE;
 
        /* low bit indicates receives are present, so schedule
         * napi poll handler */
@@ -1599,7 +1599,7 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
                myri10ge_check_statblock(mgp);
 
        put_be32(htonl(3), ss->irq_claim + 1);
-       return (IRQ_HANDLED);
+       return IRQ_HANDLED;
 }
 
 static int
@@ -3753,8 +3753,8 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
         * slices. We give up on MSI-X if we can only get a single
         * vector. */
 
-       mgp->msix_vectors = kzalloc(mgp->num_slices *
-                                   sizeof(*mgp->msix_vectors), GFP_KERNEL);
+       mgp->msix_vectors = kcalloc(mgp->num_slices, sizeof(*mgp->msix_vectors),
+                                   GFP_KERNEL);
        if (mgp->msix_vectors == NULL)
                goto disable_msix;
        for (i = 0; i < mgp->num_slices; i++) {
@@ -3923,7 +3923,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                dev_err(&pdev->dev, "failed to alloc slice state\n");
                goto abort_with_firmware;
        }
-       netdev->real_num_tx_queues = mgp->num_slices;
+       netif_set_real_num_tx_queues(netdev, mgp->num_slices);
+       netif_set_real_num_rx_queues(netdev, mgp->num_slices);
        status = myri10ge_reset(mgp);
        if (status != 0) {
                dev_err(&pdev->dev, "failed reset\n");