From 501b81d0dc746b9f323c5b597c94b492012e7495 Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Tue, 12 Aug 2014 10:47:21 +0200 Subject: can: flexcan: Disable error interrupt when bus error reporting is disabled In case we don't have FLEXCAN_HAS_BROKEN_ERR_STATE and the user set CAN_CTRLMODE_BERR_REPORTING once it can not be unset again until reboot. So in case neither hardware nor user wants the error interrupt disable the bit. Signed-off-by: Alexander Stein Signed-off-by: Marc Kleine-Budde --- Cherry-picked from linux-next: bc03a54139baafcd8fe89ad115411c2c9c8a4905 Change-Id: Ieb52a8f0cc761a37faf4556284bf2c922c6bec79 Reviewed-on: http://git.am.freescale.net:8181/21844 Tested-by: Review Code-CDREVIEW Reviewed-by: Zhengxiong Jin diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 7e816e9..826b424 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -908,6 +908,8 @@ static int flexcan_chip_start(struct net_device *dev) if (priv->devtype_data->features & FLEXCAN_HAS_BROKEN_ERR_STATE || priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) reg_ctrl |= FLEXCAN_CTRL_ERR_MSK; + else + reg_ctrl &= ~FLEXCAN_CTRL_ERR_MSK; /* save for later use */ priv->reg_ctrl_default = reg_ctrl; -- cgit v0.10.2