firmware: imx: scu: Use devm_mutex_init

In normal case, there is no need to invoke mutex_destroy in error path,
but it is useful when CONFIG_DEBUG_MUTEXES, so use devm_mutex_init().

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
This commit is contained in:
Peng Fan 2025-10-17 09:56:31 +08:00 committed by Shawn Guo
parent ff79af939d
commit 97a07dd2b5
1 changed files with 3 additions and 1 deletions

View File

@ -324,7 +324,9 @@ static int imx_scu_probe(struct platform_device *pdev)
}
sc_ipc->dev = dev;
mutex_init(&sc_ipc->lock);
ret = devm_mutex_init(dev, &sc_ipc->lock);
if (ret)
return ret;
init_completion(&sc_ipc->done);
imx_sc_ipc_handle = sc_ipc;