aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2018-01-10 05:55:20 -0500
committerMarc Kleine-Budde <mkl@pengutronix.de>2018-01-16 09:11:33 -0500
commitb25abca6aa4fd2fcdafc214d489ccd57df67e88e (patch)
tree13503df94160230f72dbf76f870c5a412a0d08c4
parente759c626d826649cf393da34cd59656d08afb52d (diff)
can: m_can: Remove check for version when allocating m_can net device
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>
-rw-r--r--drivers/net/can/m_can/m_can.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 79dd3c36ea32..4f7de0b07c9b 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1253,7 +1253,6 @@ static struct net_device *alloc_m_can_dev(struct platform_device *pdev,
1253 struct net_device *dev; 1253 struct net_device *dev;
1254 struct m_can_priv *priv; 1254 struct m_can_priv *priv;
1255 int m_can_version; 1255 int m_can_version;
1256 unsigned int echo_buffer_count;
1257 1256
1258 m_can_version = m_can_check_core_release(addr); 1257 m_can_version = m_can_check_core_release(addr);
1259 /* return if unsupported version */ 1258 /* return if unsupported version */
@@ -1262,12 +1261,7 @@ static struct net_device *alloc_m_can_dev(struct platform_device *pdev,
1262 goto return_dev; 1261 goto return_dev;
1263 } 1262 }
1264 1263
1265 /* If version < 3.1.x, then only one echo buffer is used */ 1264 dev = alloc_candev(sizeof(*priv), tx_fifo_size);
1266 echo_buffer_count = ((m_can_version == 30)
1267 ? 1U
1268 : (unsigned int)tx_fifo_size);
1269
1270 dev = alloc_candev(sizeof(*priv), echo_buffer_count);
1271 if (!dev) { 1265 if (!dev) {
1272 dev = NULL; 1266 dev = NULL;
1273 goto return_dev; 1267 goto return_dev;