]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
can: xilinx: tx->head and tx->tail are initialized properly.
authorMousumi Jana <mousumi.jana@xilinx.com>
Thu, 12 Oct 2017 11:32:56 +0000 (17:02 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 17 Oct 2017 09:01:37 +0000 (11:01 +0200)
This patch adds the support for initialization of the counters
tx->head and tx->tail properly.

Signed-off-by: Mousumi Jana <mousumij@xilinx.com>
Reviewed-by: Kedareswara Rao appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/can/xilinx_can.c

index d33513354aff5a2934e13f296cb58688e0664a41..f238670889824010d0d397c3cbdac828b5ff8fe2 100644 (file)
@@ -502,6 +502,9 @@ static int xcan_chip_start(struct net_device *ndev)
                   priv->read_reg(priv, XCAN_SR_OFFSET));
 
        priv->can.state = CAN_STATE_ERROR_ACTIVE;
+       priv->tx_head = 0;
+       priv->tx_tail = 0;
+
        return 0;
 }
 
@@ -1512,6 +1515,8 @@ static int xcan_probe(struct platform_device *pdev)
        }
        priv->reg_base = addr;
        priv->tx_max = tx_max;
+       priv->tx_head = 0;
+       priv->tx_tail = 0;
 
        /* Get IRQ for the device */
        ndev->irq = platform_get_irq(pdev, 0);