Skip to content

Commit cd0d83e

Browse files
wushifu32marckleinebudde
authored andcommitted
can: m_can: m_can_handle_state_change(): fix state change
m_can_handle_state_change() is called with the new_state as an argument. In the switch statements for CAN_STATE_ERROR_ACTIVE, the comment and the following code indicate that a CAN_STATE_ERROR_WARNING is handled. This patch fixes this problem by changing the case to CAN_STATE_ERROR_WARNING. Signed-off-by: Wu Bo <wubo.oduw@gmail.com> Link: http://lore.kernel.org/r/20200129022330.21248-2-wubo.oduw@gmail.com Cc: Dan Murphy <dmurphy@ti.com> Fixes: e0d1f48 ("can: m_can: add Bosch M_CAN controller support") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent c81d0b6 commit cd0d83e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/can/m_can/m_can.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ static int m_can_handle_state_change(struct net_device *dev,
665665
unsigned int ecr;
666666

667667
switch (new_state) {
668-
case CAN_STATE_ERROR_ACTIVE:
668+
case CAN_STATE_ERROR_WARNING:
669669
/* error warning state */
670670
cdev->can.can_stats.error_warning++;
671671
cdev->can.state = CAN_STATE_ERROR_WARNING;
@@ -694,7 +694,7 @@ static int m_can_handle_state_change(struct net_device *dev,
694694
__m_can_get_berr_counter(dev, &bec);
695695

696696
switch (new_state) {
697-
case CAN_STATE_ERROR_ACTIVE:
697+
case CAN_STATE_ERROR_WARNING:
698698
/* error warning state */
699699
cf->can_id |= CAN_ERR_CRTL;
700700
cf->data[1] = (bec.txerr > bec.rxerr) ?

0 commit comments

Comments
 (0)