summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/can/flexcan.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 320bef2dba42..dcd69c9374ae 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -827,14 +827,16 @@ static void flexcan_chip_stop(struct net_device *dev)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg;
- /* Disable all interrupts */
- flexcan_write(0, &regs->imask1);
-
/* Disable + halt module */
reg = flexcan_read(&regs->mcr);
reg |= FLEXCAN_MCR_MDIS | FLEXCAN_MCR_HALT;
flexcan_write(reg, &regs->mcr);
+ /* Disable all interrupts */
+ flexcan_write(0, &regs->imask1);
+ flexcan_write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
+ &regs->ctrl);
+
if (priv->reg_xceiver)
regulator_disable(priv->reg_xceiver);
priv->can.state = CAN_STATE_STOPPED;