summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2025-08-10 04:30:32 +0300
committerHans Verkuil <hverkuil+cisco@kernel.org>2025-08-13 09:33:51 +0300
commit3cf9bbb526534f8f1c96b3ca81bf162e0ffb633c (patch)
treea49b26131b35a991a18c5ef3760dc7368a94d871
parent8fbb206557ce7dd4f4881251d8c963421c5f064e (diff)
downloadlinux-3cf9bbb526534f8f1c96b3ca81bf162e0ffb633c.tar.xz
media: rockhip: rga: Access v4l2_fh from file
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. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
-rw-r--r--drivers/media/platform/rockchip/rga/rga.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
index 45c42c7ad846..7c657df623f2 100644
--- a/drivers/media/platform/rockchip/rga/rga.c
+++ b/drivers/media/platform/rockchip/rga/rga.c
@@ -462,7 +462,7 @@ static int vidioc_enum_fmt(struct file *file, void *prv, struct v4l2_fmtdesc *f)
static int vidioc_g_fmt(struct file *file, void *prv, struct v4l2_format *f)
{
struct v4l2_pix_format_mplane *pix_fmt = &f->fmt.pix_mp;
- struct rga_ctx *ctx = prv;
+ struct rga_ctx *ctx = file_to_rga_ctx(file);
struct vb2_queue *vq;
struct rga_frame *frm;
@@ -504,7 +504,7 @@ static int vidioc_try_fmt(struct file *file, void *prv, struct v4l2_format *f)
static int vidioc_s_fmt(struct file *file, void *prv, struct v4l2_format *f)
{
struct v4l2_pix_format_mplane *pix_fmt = &f->fmt.pix_mp;
- struct rga_ctx *ctx = prv;
+ struct rga_ctx *ctx = file_to_rga_ctx(file);
struct rockchip_rga *rga = ctx->rga;
struct vb2_queue *vq;
struct rga_frame *frm;
@@ -561,7 +561,7 @@ static int vidioc_s_fmt(struct file *file, void *prv, struct v4l2_format *f)
static int vidioc_g_selection(struct file *file, void *prv,
struct v4l2_selection *s)
{
- struct rga_ctx *ctx = prv;
+ struct rga_ctx *ctx = file_to_rga_ctx(file);
struct rga_frame *f;
bool use_frame = false;
@@ -609,7 +609,7 @@ static int vidioc_g_selection(struct file *file, void *prv,
static int vidioc_s_selection(struct file *file, void *prv,
struct v4l2_selection *s)
{
- struct rga_ctx *ctx = prv;
+ struct rga_ctx *ctx = file_to_rga_ctx(file);
struct rockchip_rga *rga = ctx->rga;
struct rga_frame *f;
int ret = 0;