]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
can: m_can: m_can_plat_remove(): add missing pm_runtime_disable()
authorMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 6 Aug 2025 15:46:32 +0000 (17:46 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 8 Oct 2025 08:18:28 +0000 (10:18 +0200)
Commit 227619c3ff7c ("can: m_can: move runtime PM enable/disable to
m_can_platform") moved the PM runtime enable from the m_can core
driver into the m_can_platform.

That patch forgot to move the pm_runtime_disable() to
m_can_plat_remove(), so that unloading the m_can_platform driver
causes an "Unbalanced pm_runtime_enable!" error message.

Add the missing pm_runtime_disable() to m_can_plat_remove() to fix the
problem.

Cc: Patrik Flykt <patrik.flykt@linux.intel.com>
Fixes: 227619c3ff7c ("can: m_can: move runtime PM enable/disable to m_can_platform")
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Link: https://patch.msgid.link/20250929-m_can-fix-state-handling-v4-1-682b49b49d9a@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/m_can_platform.c

index b832566efda042929486578fad1879c7ad4a0cff..057eaa7b8b4b2969060c811c8a9adc8a1abf5ede 100644 (file)
@@ -180,7 +180,7 @@ static void m_can_plat_remove(struct platform_device *pdev)
        struct m_can_classdev *mcan_class = &priv->cdev;
 
        m_can_class_unregister(mcan_class);
-
+       pm_runtime_disable(mcan_class->dev);
        m_can_class_free_dev(mcan_class->net);
 }