[PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE when resume has no issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Haibo Chen <haibo.chen@xxxxxxx>

Only set CAN state to CAN_STATE_ERROR_ACTIVE when resume process has
no issue, otherwise keep in CAN_STATE_SLEEPING as suspend did.

Signed-off-by: Haibo Chen <haibo.chen@xxxxxxx>
---
 drivers/net/can/flexcan/flexcan-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index b347a1c93536..8415ef71f1b1 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -2311,7 +2311,6 @@ static int __maybe_unused flexcan_resume(struct device *device)
 	struct flexcan_priv *priv = netdev_priv(dev);
 	int err;
 
-	priv->can.state = CAN_STATE_ERROR_ACTIVE;
 	if (netif_running(dev)) {
 		netif_device_attach(dev);
 		netif_start_queue(dev);
@@ -2332,6 +2331,7 @@ static int __maybe_unused flexcan_resume(struct device *device)
 			flexcan_chip_interrupts_enable(dev);
 		}
 	}
+	priv->can.state = CAN_STATE_ERROR_ACTIVE;
 
 	return 0;
 }
-- 
2.34.1





[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux