mirror of
https://github.com/torvalds/linux.git
synced 2026-07-29 18:51:21 +02:00
media: staging: imx: 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> Co-developed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
ee7aa3dff3
commit
d2683099c4
|
|
@ -23,8 +23,6 @@
|
|||
|
||||
#include "imx-media.h"
|
||||
|
||||
#define fh_to_ctx(__fh) container_of(__fh, struct ipu_csc_scaler_ctx, fh)
|
||||
|
||||
#define IMX_CSC_SCALER_NAME "imx-csc-scaler"
|
||||
|
||||
enum {
|
||||
|
|
@ -68,7 +66,7 @@ struct ipu_csc_scaler_ctx {
|
|||
|
||||
static inline struct ipu_csc_scaler_ctx *file_to_ctx(struct file *filp)
|
||||
{
|
||||
return fh_to_ctx(file_to_v4l2_fh(filp));
|
||||
return container_of(file_to_v4l2_fh(filp), struct ipu_csc_scaler_ctx, fh);
|
||||
}
|
||||
|
||||
static struct ipu_csc_scaler_q_data *get_q_data(struct ipu_csc_scaler_ctx *ctx,
|
||||
|
|
@ -184,7 +182,7 @@ static int ipu_csc_scaler_enum_fmt(struct file *file, void *fh,
|
|||
static int ipu_csc_scaler_g_fmt(struct file *file, void *priv,
|
||||
struct v4l2_format *f)
|
||||
{
|
||||
struct ipu_csc_scaler_ctx *ctx = fh_to_ctx(priv);
|
||||
struct ipu_csc_scaler_ctx *ctx = file_to_ctx(file);
|
||||
struct ipu_csc_scaler_q_data *q_data;
|
||||
|
||||
q_data = get_q_data(ctx, f->type);
|
||||
|
|
@ -197,7 +195,7 @@ static int ipu_csc_scaler_g_fmt(struct file *file, void *priv,
|
|||
static int ipu_csc_scaler_try_fmt(struct file *file, void *priv,
|
||||
struct v4l2_format *f)
|
||||
{
|
||||
struct ipu_csc_scaler_ctx *ctx = fh_to_ctx(priv);
|
||||
struct ipu_csc_scaler_ctx *ctx = file_to_ctx(file);
|
||||
struct ipu_csc_scaler_q_data *q_data = get_q_data(ctx, f->type);
|
||||
struct ipu_image test_in, test_out;
|
||||
enum v4l2_field field;
|
||||
|
|
@ -245,8 +243,8 @@ static int ipu_csc_scaler_try_fmt(struct file *file, void *priv,
|
|||
static int ipu_csc_scaler_s_fmt(struct file *file, void *priv,
|
||||
struct v4l2_format *f)
|
||||
{
|
||||
struct ipu_csc_scaler_ctx *ctx = file_to_ctx(file);
|
||||
struct ipu_csc_scaler_q_data *q_data;
|
||||
struct ipu_csc_scaler_ctx *ctx = fh_to_ctx(priv);
|
||||
struct vb2_queue *vq;
|
||||
int ret;
|
||||
|
||||
|
|
@ -301,7 +299,7 @@ static int ipu_csc_scaler_s_fmt(struct file *file, void *priv,
|
|||
static int ipu_csc_scaler_g_selection(struct file *file, void *priv,
|
||||
struct v4l2_selection *s)
|
||||
{
|
||||
struct ipu_csc_scaler_ctx *ctx = fh_to_ctx(priv);
|
||||
struct ipu_csc_scaler_ctx *ctx = file_to_ctx(file);
|
||||
struct ipu_csc_scaler_q_data *q_data;
|
||||
|
||||
switch (s->target) {
|
||||
|
|
@ -339,7 +337,7 @@ static int ipu_csc_scaler_g_selection(struct file *file, void *priv,
|
|||
static int ipu_csc_scaler_s_selection(struct file *file, void *priv,
|
||||
struct v4l2_selection *s)
|
||||
{
|
||||
struct ipu_csc_scaler_ctx *ctx = fh_to_ctx(priv);
|
||||
struct ipu_csc_scaler_ctx *ctx = file_to_ctx(file);
|
||||
struct ipu_csc_scaler_q_data *q_data;
|
||||
|
||||
switch (s->target) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user