firmware: turris-mox-rwtm: Use devm_mutex_init() instead of mutex_init()
Use devm_mutex_init() instead of mutex_init(), to properly call mutex_destroy() on probe failure / driver unbind. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240831092050.23093-13-kabel@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
ed09d6d4f5
commit
db955e0847
@ -456,7 +456,10 @@ static int turris_mox_rwtm_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, rwtm);
|
||||
|
||||
mutex_init(&rwtm->busy);
|
||||
ret = devm_mutex_init(dev, &rwtm->busy);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
init_completion(&rwtm->cmd_done);
|
||||
|
||||
rwtm->mbox_client.dev = dev;
|
||||
|
Loading…
Reference in New Issue
Block a user