mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user