Skip to content

Commit 97a07dd

Browse files
MrVanShawn Guo
authored andcommitted
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>
1 parent ff79af9 commit 97a07dd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/firmware/imx/imx-scu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ static int imx_scu_probe(struct platform_device *pdev)
324324
}
325325

326326
sc_ipc->dev = dev;
327-
mutex_init(&sc_ipc->lock);
327+
ret = devm_mutex_init(dev, &sc_ipc->lock);
328+
if (ret)
329+
return ret;
328330
init_completion(&sc_ipc->done);
329331

330332
imx_sc_ipc_handle = sc_ipc;

0 commit comments

Comments
 (0)