[PATCH] staging: nvec: disable i2c slave on remove

From: Balakrishnan Sambath

Date: Thu Jul 02 2026 - 07:04:32 EST


tegra_init_i2c_slave() runs from probe and enables the i2c controller
clock with clk_prepare_enable(), and enables the interrupt.
tegra_nvec_remove() removes the mfd devices, notifier and work queues
but never calls the matching nvec_disable_i2c_slave(), so the clock's
prepare/enable count is leaked on unbind and the controller clock is
left running with no user.

The leak is only reached on driver unbind, which is why it has gone
unnoticed in normal use.

Call nvec_disable_i2c_slave() on remove, the same teardown the suspend
path already does.

Fixes: 61c3b1971ad4 ("staging: nvec: add clk_prepare/clk_unprepare")
Signed-off-by: Balakrishnan Sambath <balakrishnan.s@xxxxxxxxxxxxx>
---
drivers/staging/nvec/nvec.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 88c416ee0381..3869c16ad3c8 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -908,6 +908,7 @@ static void tegra_nvec_remove(struct platform_device *pdev)
cancel_work_sync(&nvec->tx_work);
if (pm_power_off == nvec_power_off)
pm_power_off = NULL;
+ nvec_disable_i2c_slave(nvec);
}

#ifdef CONFIG_PM_SLEEP

---
base-commit: be5c93fa674f0fc3c8f359c2143abce6bbb422e6
change-id: 20260702-contrib-nvec-clk-leak-77d573a746a6

Best regards,
--
Balakrishnan Sambath <balakrishnan.s@xxxxxxxxxxxxx>