counter: ftm-quaddec: use devm_mutex_init()

ftm_quaddec_probe() calls mutex_init() but neither the cleanup
action nor a remove callback issues a matching mutex_destroy(),
so the lock debug state is leaked on driver unbind.

Switch to devm_mutex_init() so the mutex is torn down in the same
devm scope it was set up in.

Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
Link: https://lore.kernel.org/r/20260523184351.7567-1-sozdayvek@gmail.com
Signed-off-by: William Breathitt Gray <wbg@kernel.org>
This commit is contained in:
Stepan Ionichev
2026-05-23 23:43:51 +05:00
committed by William Breathitt Gray
parent ee4133b921
commit b400c076fe

View File

@@ -292,7 +292,9 @@ static int ftm_quaddec_probe(struct platform_device *pdev)
counter->signals = ftm_quaddec_signals;
counter->num_signals = ARRAY_SIZE(ftm_quaddec_signals);
mutex_init(&ftm->ftm_quaddec_mutex);
ret = devm_mutex_init(&pdev->dev, &ftm->ftm_quaddec_mutex);
if (ret)
return ret;
ftm_quaddec_init(ftm);