media: mem2mem: Remove unused v4l2_m2m_ops .lock/.unlock

Commit f1a81afc98 ("[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>
This commit is contained in:
Ezequiel Garcia 2018-06-14 11:34:03 -04:00 committed by Mauro Carvalho Chehab
parent 1b97e5275b
commit d7e913cc58
8 changed files with 6 additions and 133 deletions

View File

@ -1297,28 +1297,10 @@ static void coda_job_abort(void *priv)
"Aborting task\n");
}
static void coda_lock(void *m2m_priv)
{
struct coda_ctx *ctx = m2m_priv;
struct coda_dev *pcdev = ctx->dev;
mutex_lock(&pcdev->dev_mutex);
}
static void coda_unlock(void *m2m_priv)
{
struct coda_ctx *ctx = m2m_priv;
struct coda_dev *pcdev = ctx->dev;
mutex_unlock(&pcdev->dev_mutex);
}
static const struct v4l2_m2m_ops coda_m2m_ops = {
.device_run = coda_device_run,
.job_ready = coda_job_ready,
.job_abort = coda_job_abort,
.lock = coda_lock,
.unlock = coda_unlock,
};
static void set_default_params(struct coda_ctx *ctx)
@ -2092,9 +2074,9 @@ static int coda_open(struct file *file)
INIT_LIST_HEAD(&ctx->buffer_meta_list);
spin_lock_init(&ctx->buffer_meta_lock);
coda_lock(ctx);
mutex_lock(&dev->dev_mutex);
list_add(&ctx->list, &dev->instances);
coda_unlock(ctx);
mutex_unlock(&dev->dev_mutex);
v4l2_dbg(1, coda_debug, &dev->v4l2_dev, "Created instance %d (%p)\n",
ctx->idx, ctx);
@ -2142,9 +2124,9 @@ static int coda_release(struct file *file)
flush_work(&ctx->seq_end_work);
}
coda_lock(ctx);
mutex_lock(&dev->dev_mutex);
list_del(&ctx->list);
coda_unlock(ctx);
mutex_unlock(&dev->dev_mutex);
if (ctx->dev->devtype->product == CODA_DX6)
coda_free_aux_buf(dev, &ctx->workbuf);

View File

@ -181,20 +181,6 @@ static void deinterlace_job_abort(void *priv)
v4l2_m2m_job_finish(pcdev->m2m_dev, ctx->m2m_ctx);
}
static void deinterlace_lock(void *priv)
{
struct deinterlace_ctx *ctx = priv;
struct deinterlace_dev *pcdev = ctx->dev;
mutex_lock(&pcdev->dev_mutex);
}
static void deinterlace_unlock(void *priv)
{
struct deinterlace_ctx *ctx = priv;
struct deinterlace_dev *pcdev = ctx->dev;
mutex_unlock(&pcdev->dev_mutex);
}
static void dma_callback(void *data)
{
struct deinterlace_ctx *curr_ctx = data;
@ -956,9 +942,9 @@ static __poll_t deinterlace_poll(struct file *file,
struct deinterlace_ctx *ctx = file->private_data;
__poll_t ret;
deinterlace_lock(ctx);
mutex_lock(&ctx->dev->dev_mutex);
ret = v4l2_m2m_poll(file, ctx->m2m_ctx, wait);
deinterlace_unlock(ctx);
mutex_unlock(&ctx->dev->dev_mutex);
return ret;
}
@ -992,8 +978,6 @@ static const struct v4l2_m2m_ops m2m_ops = {
.device_run = deinterlace_device_run,
.job_ready = deinterlace_job_ready,
.job_abort = deinterlace_job_abort,
.lock = deinterlace_lock,
.unlock = deinterlace_unlock,
};
static int deinterlace_probe(struct platform_device *pdev)

View File

@ -1411,28 +1411,10 @@ int mtk_vcodec_dec_ctrls_setup(struct mtk_vcodec_ctx *ctx)
return 0;
}
static void m2mops_vdec_lock(void *m2m_priv)
{
struct mtk_vcodec_ctx *ctx = m2m_priv;
mtk_v4l2_debug(3, "[%d]", ctx->id);
mutex_lock(&ctx->dev->dev_mutex);
}
static void m2mops_vdec_unlock(void *m2m_priv)
{
struct mtk_vcodec_ctx *ctx = m2m_priv;
mtk_v4l2_debug(3, "[%d]", ctx->id);
mutex_unlock(&ctx->dev->dev_mutex);
}
const struct v4l2_m2m_ops mtk_vdec_m2m_ops = {
.device_run = m2mops_vdec_device_run,
.job_ready = m2mops_vdec_job_ready,
.job_abort = m2mops_vdec_job_abort,
.lock = m2mops_vdec_lock,
.unlock = m2mops_vdec_unlock,
};
static const struct vb2_ops mtk_vdec_vb2_ops = {

View File

@ -1181,26 +1181,10 @@ static void m2mops_venc_job_abort(void *priv)
ctx->state = MTK_STATE_ABORT;
}
static void m2mops_venc_lock(void *m2m_priv)
{
struct mtk_vcodec_ctx *ctx = m2m_priv;
mutex_lock(&ctx->dev->dev_mutex);
}
static void m2mops_venc_unlock(void *m2m_priv)
{
struct mtk_vcodec_ctx *ctx = m2m_priv;
mutex_unlock(&ctx->dev->dev_mutex);
}
const struct v4l2_m2m_ops mtk_venc_m2m_ops = {
.device_run = m2mops_venc_device_run,
.job_ready = m2mops_venc_job_ready,
.job_abort = m2mops_venc_job_abort,
.lock = m2mops_venc_lock,
.unlock = m2mops_venc_unlock,
};
void mtk_vcodec_enc_set_default_params(struct mtk_vcodec_ctx *ctx)

View File

@ -250,20 +250,6 @@ static void emmaprp_job_abort(void *priv)
v4l2_m2m_job_finish(pcdev->m2m_dev, ctx->m2m_ctx);
}
static void emmaprp_lock(void *priv)
{
struct emmaprp_ctx *ctx = priv;
struct emmaprp_dev *pcdev = ctx->dev;
mutex_lock(&pcdev->dev_mutex);
}
static void emmaprp_unlock(void *priv)
{
struct emmaprp_ctx *ctx = priv;
struct emmaprp_dev *pcdev = ctx->dev;
mutex_unlock(&pcdev->dev_mutex);
}
static inline void emmaprp_dump_regs(struct emmaprp_dev *pcdev)
{
dprintk(pcdev,
@ -885,8 +871,6 @@ static const struct video_device emmaprp_videodev = {
static const struct v4l2_m2m_ops m2m_ops = {
.device_run = emmaprp_device_run,
.job_abort = emmaprp_job_abort,
.lock = emmaprp_lock,
.unlock = emmaprp_unlock,
};
static int emmaprp_probe(struct platform_device *pdev)

View File

@ -339,22 +339,6 @@ static void register_decoders(struct delta_dev *delta)
}
}
static void delta_lock(void *priv)
{
struct delta_ctx *ctx = priv;
struct delta_dev *delta = ctx->dev;
mutex_lock(&delta->lock);
}
static void delta_unlock(void *priv)
{
struct delta_ctx *ctx = priv;
struct delta_dev *delta = ctx->dev;
mutex_unlock(&delta->lock);
}
static int delta_open_decoder(struct delta_ctx *ctx, u32 streamformat,
u32 pixelformat, const struct delta_dec **pdec)
{
@ -1099,8 +1083,6 @@ static const struct v4l2_m2m_ops delta_m2m_ops = {
.device_run = delta_device_run,
.job_ready = delta_job_ready,
.job_abort = delta_job_abort,
.lock = delta_lock,
.unlock = delta_unlock,
};
/*

View File

@ -953,23 +953,6 @@ static void job_abort(void *priv)
ctx->aborting = 1;
}
/*
* Lock access to the device
*/
static void vpe_lock(void *priv)
{
struct vpe_ctx *ctx = priv;
struct vpe_dev *dev = ctx->dev;
mutex_lock(&dev->dev_mutex);
}
static void vpe_unlock(void *priv)
{
struct vpe_ctx *ctx = priv;
struct vpe_dev *dev = ctx->dev;
mutex_unlock(&dev->dev_mutex);
}
static void vpe_dump_regs(struct vpe_dev *dev)
{
#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 = {
.device_run = device_run,
.job_ready = job_ready,
.job_abort = job_abort,
.lock = vpe_lock,
.unlock = vpe_unlock,
};
static int vpe_runtime_get(struct platform_device *pdev)

View File

@ -40,17 +40,11 @@
* v4l2_m2m_job_finish() (as if the transaction ended normally).
* This function does not have to (and will usually not) wait
* until the device enters a state when it can be stopped.
* @lock: optional. Define a driver's own lock callback, instead of using
* &v4l2_m2m_ctx->q_lock.
* @unlock: optional. Define a driver's own unlock callback, instead of
* using &v4l2_m2m_ctx->q_lock.
*/
struct v4l2_m2m_ops {
void (*device_run)(void *priv);
int (*job_ready)(void *priv);
void (*job_abort)(void *priv);
void (*lock)(void *priv);
void (*unlock)(void *priv);
};
struct v4l2_m2m_dev;