[PATCH] can: m_can: pci: add missing pm_runtime_dont_use_autosuspend() call

From: Joshua Crofts

Date: Wed Sep 16 2026 - 09:11:14 EST


m_can_pci_remove() forgets to call pm_runtime_dont_use_autosuspend() on
teardown, even though autosuspend is enabled in m_can_pci_probe().

Add the missing function call.

Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
---
Found using a Coccinelle script I'm currently working on [1].

[1] https://lore.kernel.org/cocci/20260916095616.1394-1-joshua.crofts1@xxxxxxxxx
---
drivers/net/can/m_can/m_can_pci.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/m_can/m_can_pci.c b/drivers/net/can/m_can/m_can_pci.c
index d11a7c88fc32..3c595749b5c7 100644
--- a/drivers/net/can/m_can/m_can_pci.c
+++ b/drivers/net/can/m_can/m_can_pci.c
@@ -159,6 +159,7 @@ static void m_can_pci_remove(struct pci_dev *pci)
struct m_can_pci_priv *priv = cdev_to_priv(mcan_class);

pm_runtime_forbid(&pci->dev);
+ pm_runtime_dont_use_autosuspend(&pci->dev);
pm_runtime_get_noresume(&pci->dev);

/* Disable interrupt control at CAN wrapper IP */
--
2.47.3