File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -2260,14 +2260,19 @@ static int __maybe_unused flexcan_suspend(struct device *device)
2260
2260
2261
2261
flexcan_chip_interrupts_disable (dev );
2262
2262
2263
+ err = flexcan_transceiver_disable (priv );
2264
+ if (err )
2265
+ return err ;
2266
+
2263
2267
err = pinctrl_pm_select_sleep_state (device );
2264
2268
if (err )
2265
2269
return err ;
2266
2270
}
2267
2271
netif_stop_queue (dev );
2268
2272
netif_device_detach (dev );
2273
+
2274
+ priv -> can .state = CAN_STATE_SLEEPING ;
2269
2275
}
2270
- priv -> can .state = CAN_STATE_SLEEPING ;
2271
2276
2272
2277
return 0 ;
2273
2278
}
@@ -2278,7 +2283,6 @@ static int __maybe_unused flexcan_resume(struct device *device)
2278
2283
struct flexcan_priv * priv = netdev_priv (dev );
2279
2284
int err ;
2280
2285
2281
- priv -> can .state = CAN_STATE_ERROR_ACTIVE ;
2282
2286
if (netif_running (dev )) {
2283
2287
netif_device_attach (dev );
2284
2288
netif_start_queue (dev );
@@ -2292,12 +2296,20 @@ static int __maybe_unused flexcan_resume(struct device *device)
2292
2296
if (err )
2293
2297
return err ;
2294
2298
2295
- err = flexcan_chip_start ( dev );
2299
+ err = flexcan_transceiver_enable ( priv );
2296
2300
if (err )
2297
2301
return err ;
2298
2302
2303
+ err = flexcan_chip_start (dev );
2304
+ if (err ) {
2305
+ flexcan_transceiver_disable (priv );
2306
+ return err ;
2307
+ }
2308
+
2299
2309
flexcan_chip_interrupts_enable (dev );
2300
2310
}
2311
+
2312
+ priv -> can .state = CAN_STATE_ERROR_ACTIVE ;
2301
2313
}
2302
2314
2303
2315
return 0 ;
You can’t perform that action at this time.
0 commit comments