lkml.org 
[lkml]   [2020]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] can: flexcan: use ctrlmode to enable CAN-FD
Date
The driver will enable CAN-FD mode according to the ctrlmode_supported,
which will always be true, if the controller supports it. This is wrong.
Use the correct ctrlmode instead.

Signed-off-by: Michael Walle <michael@walle.cc>
---
drivers/net/can/flexcan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 12043250e398..183e094f8d66 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1345,7 +1345,7 @@ static int flexcan_chip_start(struct net_device *dev)
reg_mcr |= FLEXCAN_MCR_SRX_DIS;

/* MCR - CAN-FD */
- if (priv->can.ctrlmode_supported & CAN_CTRLMODE_FD)
+ if (priv->can.ctrlmode & CAN_CTRLMODE_FD)
reg_mcr |= FLEXCAN_MCR_FDEN;
else
reg_mcr &= ~FLEXCAN_MCR_FDEN;
--
2.20.1
\
 
 \ /
  Last update: 2020-06-29 23:45    [W:0.067 / U:0.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site