static int zoran_querycap(struct file *file, void *__fh, struct v4l2_capability *cap)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
strscpy(cap->card, ZR_DEVNAME(zr), sizeof(cap->card));
strscpy(cap->driver, "zoran", sizeof(cap->driver));
static int zoran_enum_fmt_vid_cap(struct file *file, void *__fh,
struct v4l2_fmtdesc *f)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
return zoran_enum_fmt(zr, f, ZORAN_FORMAT_CAPTURE);
}
static int zoran_enum_fmt_vid_out(struct file *file, void *__fh,
struct v4l2_fmtdesc *f)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
return zoran_enum_fmt(zr, f, ZORAN_FORMAT_PLAYBACK);
}
static int zoran_enum_fmt_vid_overlay(struct file *file, void *__fh,
struct v4l2_fmtdesc *f)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
return zoran_enum_fmt(zr, f, ZORAN_FORMAT_OVERLAY);
}
static int zoran_g_fmt_vid_overlay(struct file *file, void *__fh,
struct v4l2_format *fmt)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
fmt->fmt.win.w.left = zr->overlay_settings.x;
fmt->fmt.win.w.top = zr->overlay_settings.y;
static int zoran_try_fmt_vid_overlay(struct file *file, void *__fh,
struct v4l2_format *fmt)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
if (fmt->fmt.win.w.width > BUZ_MAX_WIDTH)
fmt->fmt.win.w.width = BUZ_MAX_WIDTH;
static int zoran_s_fmt_vid_cap(struct file *file, void *__fh,
struct v4l2_format *fmt)
{
+ struct zoran *zr = video_drvdata(file);
struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
int i;
int res = 0;
static int zoran_g_fbuf(struct file *file, void *__fh,
struct v4l2_framebuffer *fb)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
memset(fb, 0, sizeof(*fb));
fb->base = zr->vbuf_base;
static int zoran_s_fbuf(struct file *file, void *__fh,
const struct v4l2_framebuffer *fb)
{
+ struct zoran *zr = video_drvdata(file);
struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
int i, res = 0;
__le32 printformat = __cpu_to_le32(fb->fmt.pixelformat);
static int zoran_g_std(struct file *file, void *__fh, v4l2_std_id *std)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
*std = zr->norm;
return 0;
static int zoran_s_std(struct file *file, void *__fh, v4l2_std_id std)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
int res = 0;
res = zoran_set_norm(zr, std);
static int zoran_enum_input(struct file *file, void *__fh,
struct v4l2_input *inp)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
if (inp->index >= zr->card.inputs)
return -EINVAL;
static int zoran_g_input(struct file *file, void *__fh, unsigned int *input)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
*input = zr->input;
static int zoran_s_input(struct file *file, void *__fh, unsigned int input)
{
- struct zoran_fh *fh = __fh;
- struct zoran *zr = fh->zr;
+ struct zoran *zr = video_drvdata(file);
int res;
res = zoran_set_input(zr, input);