summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-04-11 08:13:15 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2014-04-24 22:08:57 +0200
commitb9011aae9389c8853c1ccc2236f500a6e648c525 (patch)
tree02d0592a58d8004fc9365ae076b76362003d64ba /drivers
parent6b48ff8d934ab5ca6697b0e311e7869ff4a1d3f3 (diff)
can: c_can: Avoid status register update for D_CAN
On D_CAN the RXOK, TXOK and LEC bits are cleared/set on read of the status register. No need to update them. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/can/c_can/c_can.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 2aae073a1dc..b381f7bfb89 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -1041,7 +1041,8 @@ static int c_can_handle_bus_err(struct net_device *dev,
}
/* set a `lec` value so that we can check for updates later */
- priv->write_reg(priv, C_CAN_STS_REG, LEC_UNUSED);
+ if (priv->type != BOSCH_D_CAN)
+ priv->write_reg(priv, C_CAN_STS_REG, LEC_UNUSED);
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
@@ -1066,11 +1067,13 @@ static int c_can_poll(struct napi_struct *napi, int quota)
C_CAN_STS_REG);
/* handle Tx/Rx events */
- if (priv->current_status & STATUS_TXOK)
+ if (priv->current_status & STATUS_TXOK &&
+ priv->type != BOSCH_D_CAN)
priv->write_reg(priv, C_CAN_STS_REG,
priv->current_status & ~STATUS_TXOK);
- if (priv->current_status & STATUS_RXOK)
+ if (priv->current_status & STATUS_RXOK &&
+ priv->type != BOSCH_D_CAN)
priv->write_reg(priv, C_CAN_STS_REG,
priv->current_status & ~STATUS_RXOK);