diff mbox series

[V2,3/3] can: flexcan: disable runtime PM if register flexcandev failed

Message ID 20200927160801.28569-4-qiangqing.zhang@nxp.com
State New
Headers show
Series patch set for flexcan | expand

Commit Message

Joakim Zhang Sept. 27, 2020, 4:08 p.m. UTC
Disable runtime PM if register flexcandev failed, and balance reference
of usage_count.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
ChangeLogs:
V1->V2:
	* no changes.
---
 drivers/net/can/flexcan.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 4844dbf77c9c..ee6d220a4b12 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -2075,6 +2075,8 @@  static int flexcan_probe(struct platform_device *pdev)
 	return 0;
 
  failed_register:
+	pm_runtime_put_noidle(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
 	free_candev(dev);
 	return err;
 }