aboutsummaryrefslogtreecommitdiff
path: root/drivers/firmware
diff options
context:
space:
mode:
authorMarek BehĂșn2024-08-31 11:20:46 +0200
committerArnd Bergmann2024-09-02 09:42:10 +0000
commitdb955e0847484c64c6e749659527b5f45b2b5749 (patch)
tree32f3eb355ecdb993a78514c5ba11c899b2a59e58 /drivers/firmware
parented09d6d4f5938626823af3d2a04ff3a395bd348a (diff)
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>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/turris-mox-rwtm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index d12e29625022..9f6bda969943 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -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;