]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:04:33 +0000 (14:04 +0100)
[ Upstream commit ba569fb07a7e9e9b71e9282e27e993ba859295c2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/m_can/m_can_platform.c

index de6d8e01bf2e81e97d61d222bc3afc031d7264fc..71cf3662128a1a8f61708c8ad40f17bcb5398940 100644 (file)
@@ -170,7 +170,7 @@ static int 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);
 
        return 0;