Skip to content

Commit d7e913c

Browse files
ezequielgarciamchehab
authored andcommitted
media: mem2mem: Remove unused v4l2_m2m_ops .lock/.unlock
Commit f1a81af ("[media] m2m: fix bad unlock balance") removed the last use of v4l2_m2m_ops.lock and v4l2_m2m_ops.unlock hooks. They are not actually used anymore. Remove them. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
1 parent 1b97e52 commit d7e913c

8 files changed

Lines changed: 6 additions & 133 deletions

File tree

‎drivers/media/platform/coda/coda-common.c‎

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,28 +1297,10 @@ static void coda_job_abort(void *priv)
12971297
"Aborting task\n");
12981298
}
12991299

1300-
static void coda_lock(void *m2m_priv)
1301-
{
1302-
struct coda_ctx *ctx = m2m_priv;
1303-
struct coda_dev *pcdev = ctx->dev;
1304-
1305-
mutex_lock(&pcdev->dev_mutex);
1306-
}
1307-
1308-
static void coda_unlock(void *m2m_priv)
1309-
{
1310-
struct coda_ctx *ctx = m2m_priv;
1311-
struct coda_dev *pcdev = ctx->dev;
1312-
1313-
mutex_unlock(&pcdev->dev_mutex);
1314-
}
1315-
13161300
static const struct v4l2_m2m_ops coda_m2m_ops = {
13171301
.device_run = coda_device_run,
13181302
.job_ready = coda_job_ready,
13191303
.job_abort = coda_job_abort,
1320-
.lock = coda_lock,
1321-
.unlock = coda_unlock,
13221304
};
13231305

13241306
static void set_default_params(struct coda_ctx *ctx)
@@ -2092,9 +2074,9 @@ static int coda_open(struct file *file)
20922074
INIT_LIST_HEAD(&ctx->buffer_meta_list);
20932075
spin_lock_init(&ctx->buffer_meta_lock);
20942076

2095-
coda_lock(ctx);
2077+
mutex_lock(&dev->dev_mutex);
20962078
list_add(&ctx->list, &dev->instances);
2097-
coda_unlock(ctx);
2079+
mutex_unlock(&dev->dev_mutex);
20982080

20992081
v4l2_dbg(1, coda_debug, &dev->v4l2_dev, "Created instance %d (%p)\n",
21002082
ctx->idx, ctx);
@@ -2142,9 +2124,9 @@ static int coda_release(struct file *file)
21422124
flush_work(&ctx->seq_end_work);
21432125
}
21442126

2145-
coda_lock(ctx);
2127+
mutex_lock(&dev->dev_mutex);
21462128
list_del(&ctx->list);
2147-
coda_unlock(ctx);
2129+
mutex_unlock(&dev->dev_mutex);
21482130

21492131
if (ctx->dev->devtype->product == CODA_DX6)
21502132
coda_free_aux_buf(dev, &ctx->workbuf);

‎drivers/media/platform/m2m-deinterlace.c‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -181,20 +181,6 @@ static void deinterlace_job_abort(void *priv)
181181
v4l2_m2m_job_finish(pcdev->m2m_dev, ctx->m2m_ctx);
182182
}
183183

184-
static void deinterlace_lock(void *priv)
185-
{
186-
struct deinterlace_ctx *ctx = priv;
187-
struct deinterlace_dev *pcdev = ctx->dev;
188-
mutex_lock(&pcdev->dev_mutex);
189-
}
190-
191-
static void deinterlace_unlock(void *priv)
192-
{
193-
struct deinterlace_ctx *ctx = priv;
194-
struct deinterlace_dev *pcdev = ctx->dev;
195-
mutex_unlock(&pcdev->dev_mutex);
196-
}
197-
198184
static void dma_callback(void *data)
199185
{
200186
struct deinterlace_ctx *curr_ctx = data;
@@ -956,9 +942,9 @@ static __poll_t deinterlace_poll(struct file *file,
956942
struct deinterlace_ctx *ctx = file->private_data;
957943
__poll_t ret;
958944

959-
deinterlace_lock(ctx);
945+
mutex_lock(&ctx->dev->dev_mutex);
960946
ret = v4l2_m2m_poll(file, ctx->m2m_ctx, wait);
961-
deinterlace_unlock(ctx);
947+
mutex_unlock(&ctx->dev->dev_mutex);
962948

963949
return ret;
964950
}
@@ -992,8 +978,6 @@ static const struct v4l2_m2m_ops m2m_ops = {
992978
.device_run = deinterlace_device_run,
993979
.job_ready = deinterlace_job_ready,
994980
.job_abort = deinterlace_job_abort,
995-
.lock = deinterlace_lock,
996-
.unlock = deinterlace_unlock,
997981
};
998982

999983
static int deinterlace_probe(struct platform_device *pdev)

‎drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,28 +1411,10 @@ int mtk_vcodec_dec_ctrls_setup(struct mtk_vcodec_ctx *ctx)
14111411
return 0;
14121412
}
14131413

1414-
static void m2mops_vdec_lock(void *m2m_priv)
1415-
{
1416-
struct mtk_vcodec_ctx *ctx = m2m_priv;
1417-
1418-
mtk_v4l2_debug(3, "[%d]", ctx->id);
1419-
mutex_lock(&ctx->dev->dev_mutex);
1420-
}
1421-
1422-
static void m2mops_vdec_unlock(void *m2m_priv)
1423-
{
1424-
struct mtk_vcodec_ctx *ctx = m2m_priv;
1425-
1426-
mtk_v4l2_debug(3, "[%d]", ctx->id);
1427-
mutex_unlock(&ctx->dev->dev_mutex);
1428-
}
1429-
14301414
const struct v4l2_m2m_ops mtk_vdec_m2m_ops = {
14311415
.device_run = m2mops_vdec_device_run,
14321416
.job_ready = m2mops_vdec_job_ready,
14331417
.job_abort = m2mops_vdec_job_abort,
1434-
.lock = m2mops_vdec_lock,
1435-
.unlock = m2mops_vdec_unlock,
14361418
};
14371419

14381420
static const struct vb2_ops mtk_vdec_vb2_ops = {

‎drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,26 +1181,10 @@ static void m2mops_venc_job_abort(void *priv)
11811181
ctx->state = MTK_STATE_ABORT;
11821182
}
11831183

1184-
static void m2mops_venc_lock(void *m2m_priv)
1185-
{
1186-
struct mtk_vcodec_ctx *ctx = m2m_priv;
1187-
1188-
mutex_lock(&ctx->dev->dev_mutex);
1189-
}
1190-
1191-
static void m2mops_venc_unlock(void *m2m_priv)
1192-
{
1193-
struct mtk_vcodec_ctx *ctx = m2m_priv;
1194-
1195-
mutex_unlock(&ctx->dev->dev_mutex);
1196-
}
1197-
11981184
const struct v4l2_m2m_ops mtk_venc_m2m_ops = {
11991185
.device_run = m2mops_venc_device_run,
12001186
.job_ready = m2mops_venc_job_ready,
12011187
.job_abort = m2mops_venc_job_abort,
1202-
.lock = m2mops_venc_lock,
1203-
.unlock = m2mops_venc_unlock,
12041188
};
12051189

12061190
void mtk_vcodec_enc_set_default_params(struct mtk_vcodec_ctx *ctx)

‎drivers/media/platform/mx2_emmaprp.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,20 +250,6 @@ static void emmaprp_job_abort(void *priv)
250250
v4l2_m2m_job_finish(pcdev->m2m_dev, ctx->m2m_ctx);
251251
}
252252

253-
static void emmaprp_lock(void *priv)
254-
{
255-
struct emmaprp_ctx *ctx = priv;
256-
struct emmaprp_dev *pcdev = ctx->dev;
257-
mutex_lock(&pcdev->dev_mutex);
258-
}
259-
260-
static void emmaprp_unlock(void *priv)
261-
{
262-
struct emmaprp_ctx *ctx = priv;
263-
struct emmaprp_dev *pcdev = ctx->dev;
264-
mutex_unlock(&pcdev->dev_mutex);
265-
}
266-
267253
static inline void emmaprp_dump_regs(struct emmaprp_dev *pcdev)
268254
{
269255
dprintk(pcdev,
@@ -885,8 +871,6 @@ static const struct video_device emmaprp_videodev = {
885871
static const struct v4l2_m2m_ops m2m_ops = {
886872
.device_run = emmaprp_device_run,
887873
.job_abort = emmaprp_job_abort,
888-
.lock = emmaprp_lock,
889-
.unlock = emmaprp_unlock,
890874
};
891875

892876
static int emmaprp_probe(struct platform_device *pdev)

‎drivers/media/platform/sti/delta/delta-v4l2.c‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -339,22 +339,6 @@ static void register_decoders(struct delta_dev *delta)
339339
}
340340
}
341341

342-
static void delta_lock(void *priv)
343-
{
344-
struct delta_ctx *ctx = priv;
345-
struct delta_dev *delta = ctx->dev;
346-
347-
mutex_lock(&delta->lock);
348-
}
349-
350-
static void delta_unlock(void *priv)
351-
{
352-
struct delta_ctx *ctx = priv;
353-
struct delta_dev *delta = ctx->dev;
354-
355-
mutex_unlock(&delta->lock);
356-
}
357-
358342
static int delta_open_decoder(struct delta_ctx *ctx, u32 streamformat,
359343
u32 pixelformat, const struct delta_dec **pdec)
360344
{
@@ -1099,8 +1083,6 @@ static const struct v4l2_m2m_ops delta_m2m_ops = {
10991083
.device_run = delta_device_run,
11001084
.job_ready = delta_job_ready,
11011085
.job_abort = delta_job_abort,
1102-
.lock = delta_lock,
1103-
.unlock = delta_unlock,
11041086
};
11051087

11061088
/*

‎drivers/media/platform/ti-vpe/vpe.c‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -953,23 +953,6 @@ static void job_abort(void *priv)
953953
ctx->aborting = 1;
954954
}
955955

956-
/*
957-
* Lock access to the device
958-
*/
959-
static void vpe_lock(void *priv)
960-
{
961-
struct vpe_ctx *ctx = priv;
962-
struct vpe_dev *dev = ctx->dev;
963-
mutex_lock(&dev->dev_mutex);
964-
}
965-
966-
static void vpe_unlock(void *priv)
967-
{
968-
struct vpe_ctx *ctx = priv;
969-
struct vpe_dev *dev = ctx->dev;
970-
mutex_unlock(&dev->dev_mutex);
971-
}
972-
973956
static void vpe_dump_regs(struct vpe_dev *dev)
974957
{
975958
#define DUMPREG(r) vpe_dbg(dev, "%-35s %08x\n", #r, read_reg(dev, VPE_##r))
@@ -2434,8 +2417,6 @@ static const struct v4l2_m2m_ops m2m_ops = {
24342417
.device_run = device_run,
24352418
.job_ready = job_ready,
24362419
.job_abort = job_abort,
2437-
.lock = vpe_lock,
2438-
.unlock = vpe_unlock,
24392420
};
24402421

24412422
static int vpe_runtime_get(struct platform_device *pdev)

‎include/media/v4l2-mem2mem.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,11 @@
4040
* v4l2_m2m_job_finish() (as if the transaction ended normally).
4141
* This function does not have to (and will usually not) wait
4242
* until the device enters a state when it can be stopped.
43-
* @lock: optional. Define a driver's own lock callback, instead of using
44-
* &v4l2_m2m_ctx->q_lock.
45-
* @unlock: optional. Define a driver's own unlock callback, instead of
46-
* using &v4l2_m2m_ctx->q_lock.
4743
*/
4844
struct v4l2_m2m_ops {
4945
void (*device_run)(void *priv);
5046
int (*job_ready)(void *priv);
5147
void (*job_abort)(void *priv);
52-
void (*lock)(void *priv);
53-
void (*unlock)(void *priv);
5448
};
5549

5650
struct v4l2_m2m_dev;

0 commit comments

Comments
 (0)