Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peng Fan and committed by
Shawn Guo
97a07dd2 ff79af93

+3 -1
+3 -1
drivers/firmware/imx/imx-scu.c
··· 324 324 } 325 325 326 326 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; 328 330 init_completion(&sc_ipc->done); 329 331 330 332 imx_sc_ipc_handle = sc_ipc;