The v4l2_fh associated with an open file handle is now guaranteed
to be available in file->private_data, initialised by v4l2_fh_add().

Access the v4l2_fh, and from there the driver-specific structure,
from the file * in all ioctl handlers.

While at it, remove the now unused fh_to_ctx() macro.

Signed-off-by: Jacopo Mondi <jacopo.mo...@ideasonboard.com>
---
 drivers/media/platform/samsung/exynos4-is/fimc-core.h |  2 --
 drivers/media/platform/samsung/exynos4-is/fimc-m2m.c  | 10 +++++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.h 
b/drivers/media/platform/samsung/exynos4-is/fimc-core.h
index 
25711df062e79eb2066f0f6eab1c1733f16c9c2d..c23cbdee7afcdfedf1a2ef0433b98af6b4478eef
 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-core.h
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.h
@@ -496,8 +496,6 @@ struct fimc_ctx {
        struct fimc_ctrls       ctrls;
 };
 
-#define fh_to_ctx(__fh) container_of(__fh, struct fimc_ctx, fh)
-
 static inline struct fimc_ctx *file_to_ctx(struct file *filp)
 {
        return container_of(file_to_v4l2_fh(filp), struct fimc_ctx, fh);
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c 
b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c
index 
609fd84f89d4ad189d0f367bb37693f15f3a618e..562c57f186c61546175b4f902f1da18fbb2f25fe
 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-m2m.c
@@ -249,7 +249,7 @@ static int fimc_m2m_enum_fmt(struct file *file, void *priv,
 static int fimc_m2m_g_fmt_mplane(struct file *file, void *fh,
                                 struct v4l2_format *f)
 {
-       struct fimc_ctx *ctx = fh_to_ctx(fh);
+       struct fimc_ctx *ctx = file_to_ctx(file);
        const struct fimc_frame *frame = ctx_get_frame(ctx, f->type);
 
        if (IS_ERR(frame))
@@ -308,7 +308,7 @@ static int fimc_try_fmt_mplane(struct fimc_ctx *ctx, struct 
v4l2_format *f)
 static int fimc_m2m_try_fmt_mplane(struct file *file, void *fh,
                                   struct v4l2_format *f)
 {
-       struct fimc_ctx *ctx = fh_to_ctx(fh);
+       struct fimc_ctx *ctx = file_to_ctx(file);
        return fimc_try_fmt_mplane(ctx, f);
 }
 
@@ -337,7 +337,7 @@ static void __set_frame_format(struct fimc_frame *frame,
 static int fimc_m2m_s_fmt_mplane(struct file *file, void *fh,
                                 struct v4l2_format *f)
 {
-       struct fimc_ctx *ctx = fh_to_ctx(fh);
+       struct fimc_ctx *ctx = file_to_ctx(file);
        struct fimc_dev *fimc = ctx->fimc_dev;
        const struct fimc_fmt *fmt;
        struct vb2_queue *vq;
@@ -376,7 +376,7 @@ static int fimc_m2m_s_fmt_mplane(struct file *file, void 
*fh,
 static int fimc_m2m_g_selection(struct file *file, void *fh,
                                struct v4l2_selection *s)
 {
-       struct fimc_ctx *ctx = fh_to_ctx(fh);
+       struct fimc_ctx *ctx = file_to_ctx(file);
        const struct fimc_frame *frame;
 
        frame = ctx_get_frame(ctx, s->type);
@@ -484,7 +484,7 @@ static int fimc_m2m_try_selection(struct fimc_ctx *ctx,
 static int fimc_m2m_s_selection(struct file *file, void *fh,
                                struct v4l2_selection *s)
 {
-       struct fimc_ctx *ctx = fh_to_ctx(fh);
+       struct fimc_ctx *ctx = file_to_ctx(file);
        struct fimc_dev *fimc = ctx->fimc_dev;
        struct fimc_frame *f;
        int ret;

-- 
2.49.0



_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to