Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9011aae authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Marc Kleine-Budde
Browse files

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: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 6b48ff8d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1041,6 +1041,7 @@ static int c_can_handle_bus_err(struct net_device *dev,
	}

	/* set a `lec` value so that we can check for updates later */
	if (priv->type != BOSCH_D_CAN)
		priv->write_reg(priv, C_CAN_STS_REG, LEC_UNUSED);

	stats->rx_packets++;
@@ -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);