mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 15:42:46 +00:00
can: flexcan: avoid unbalanced pm_runtime_enable warning
When do suspend/resume, meet the following warning message:
[ 30.028336] flexcan 425b0000.can: Unbalanced pm_runtime_enable!
Balance the pm_runtime_force_suspend() and pm_runtime_force_resume().
Fixes: 8cb53b485f
("can: flexcan: add auto stop mode for IMX93 to support wakeup")
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://lore.kernel.org/all/20221213094351.3023858-1-haibo.chen@nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
115dd54690
commit
3bc2afcba8
1 changed files with 9 additions and 3 deletions
|
@ -2349,9 +2349,15 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
|
||||||
if (netif_running(dev)) {
|
if (netif_running(dev)) {
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
/* For the wakeup in auto stop mode, no need to gate on the
|
||||||
|
* clock here, hardware will do this automatically.
|
||||||
|
*/
|
||||||
|
if (!(device_may_wakeup(device) &&
|
||||||
|
priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)) {
|
||||||
err = pm_runtime_force_resume(device);
|
err = pm_runtime_force_resume(device);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
if (device_may_wakeup(device))
|
if (device_may_wakeup(device))
|
||||||
flexcan_enable_wakeup_irq(priv, false);
|
flexcan_enable_wakeup_irq(priv, false);
|
||||||
|
|
Loading…
Reference in a new issue