1

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:
Marek Behún 2024-08-31 11:20:46 +02:00 committed by Arnd Bergmann
parent ed09d6d4f5
commit db955e0847
No known key found for this signature in database
GPG Key ID: 60AB47FFC9095227

View File

@ -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;