[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251223102528.14355-1-bartosz.golaszewski@oss.qualcomm.com>
Date: Tue, 23 Dec 2025 11:25:28 +0100
From: Bartosz Golaszewski <bartosz.golaszewski@....qualcomm.com>
To: Vikash Garodia <vikash.garodia@....qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@....qualcomm.com>,
Abhinav Kumar <abhinav.kumar@...ux.dev>,
Bryan O'Donoghue <bod@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@....qualcomm.com>
Subject: [PATCH] media: iris: use devm_mutex_init()
Drop the call to mutex_destroy() in .remove() by using the managed API
in .probe().
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@....qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_probe.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index 9bc9b34c2576..0a4e7595a16e 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -202,8 +202,6 @@ static void iris_remove(struct platform_device *pdev)
video_unregister_device(core->vdev_enc);
v4l2_device_unregister(&core->v4l2_dev);
-
- mutex_destroy(&core->lock);
}
static void iris_sys_error_handler(struct work_struct *work)
@@ -228,9 +226,12 @@ static int iris_probe(struct platform_device *pdev)
core->dev = dev;
core->state = IRIS_CORE_DEINIT;
- mutex_init(&core->lock);
init_completion(&core->core_init_done);
+ ret = devm_mutex_init(core->dev, &core->lock);
+ if (ret)
+ return ret;
+
core->response_packet = devm_kzalloc(core->dev, IFACEQ_CORE_PKT_SIZE, GFP_KERNEL);
if (!core->response_packet)
return -ENOMEM;
--
2.47.3
Powered by blists - more mailing lists