[question] about open/release and vidioc_g_input/vidioc_s_input functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, all

After last convertion of radio drivers to use v4l2_device we have such
code in many radio drivers:
(it's radio-terratec.c for example)

...
 static int terratec_open(struct file *file)
{
        return 0;
}

static int terratec_release(struct file *file)
{
        return 0;
}
...

and

...
static int vidioc_g_input(struct file *filp, void *priv, unsigned int
*i)
{
        *i = 0;
        return 0;
}

static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
{
        return i ? -EINVAL : 0;
}
...

Such code used in many radio-drivers as i understand.

Is it good to place this empty and almost empty functions in:
(here i see two variants)

1) In header file that be in linux/drivers/media/radio/ directory.
Later, we can move some generic/or repeating code in this header.

2) In any v4l header. What header may contain this ? 

?

For what ? Well, as i understand we can decrease amount of lines and
provide this simple generic functions. It's like
video_device_release_empty function behaviour. Maybe not only radio
drivers can use such vidioc_g_input and vidioc_s_input.

Is it worth ?

-- 
Best regards, Klimov Alexey

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux