can: m_can: Remove check for version when allocating m_can net device
authorFaiz Abbas <faiz_abbas@ti.com>
Wed, 10 Jan 2018 10:55:20 +0000 (16:25 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 16 Jan 2018 14:11:33 +0000 (15:11 +0100)
Currently the m_can version is used to set the tx_fifo_count to 1 when
allocating the net device. However, this is redundant as a value of 1
for the tx_fifo_count needs to be provided in the bosch,mram-cfg
property of the device tree node anyway.

Therefore, remove check for version when allocating the net device.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can.c

index 79dd3c36ea322eefc9a21a39d67be98ce3f22a77..4f7de0b07c9b72af13e79f7eca2af1685962e6a4 100644 (file)
@@ -1253,7 +1253,6 @@ static struct net_device *alloc_m_can_dev(struct platform_device *pdev,
        struct net_device *dev;
        struct m_can_priv *priv;
        int m_can_version;
-       unsigned int echo_buffer_count;
 
        m_can_version = m_can_check_core_release(addr);
        /* return if unsupported version */
@@ -1262,12 +1261,7 @@ static struct net_device *alloc_m_can_dev(struct platform_device *pdev,
                goto return_dev;
        }
 
-       /* If version < 3.1.x, then only one echo buffer is used */
-       echo_buffer_count = ((m_can_version == 30)
-                               ? 1U
-                               : (unsigned int)tx_fifo_size);
-
-       dev = alloc_candev(sizeof(*priv), echo_buffer_count);
+       dev = alloc_candev(sizeof(*priv), tx_fifo_size);
        if (!dev) {
                dev = NULL;
                goto return_dev;