[PATCH 1/2] can: flexcan: use ctrlmode to enable CAN-FD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 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




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux