]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
firmware: imx: scu: Use devm_mutex_init
authorPeng Fan <peng.fan@nxp.com>
Fri, 17 Oct 2025 01:56:31 +0000 (09:56 +0800)
committerShawn Guo <shawnguo@kernel.org>
Mon, 27 Oct 2025 06:43:48 +0000 (14:43 +0800)
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>
drivers/firmware/imx/imx-scu.c

index 630e3dba4db15961ae4d77273af6248be614145e..67b267a7408a12deed77d2c8f52d5f64b239a408 100644 (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;