Commit c170ecf4 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (8788): v4l: replace video_get_drvdata(video_devdata(filp)) with video_drvdata(filp)

Use the new video_drvdata(filp) function where it is safe to do so.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bfa8a273
......@@ -274,7 +274,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -306,7 +306,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);
radio->curfreq = f->frequency;
if (dsbr100_setfreq(radio, radio->curfreq)==-1)
......@@ -317,7 +317,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = radio->curfreq;
......@@ -342,7 +342,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -355,7 +355,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct dsbr100_device *radio = video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -405,7 +405,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static int usb_dsbr100_open(struct inode *inode, struct file *file)
{
struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);
lock_kernel();
radio->users = 1;
......@@ -424,7 +424,7 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file)
static int usb_dsbr100_close(struct inode *inode, struct file *file)
{
struct dsbr100_device *radio=video_get_drvdata(video_devdata(file));
struct dsbr100_device *radio = video_drvdata(file);
if (!radio)
return -ENODEV;
......
......@@ -246,8 +246,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -274,8 +273,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
rt->curfreq = f->frequency;
rt_setfreq(rt, rt->curfreq);
......@@ -285,8 +283,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = rt->curfreq;
......@@ -311,8 +308,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -328,8 +324,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -196,8 +196,7 @@ static int vidioc_querycap (struct file *file, void *priv,
static int vidioc_g_tuner (struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct az_device *az = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -265,8 +264,7 @@ static int vidioc_s_audio (struct file *file, void *priv,
static int vidioc_s_frequency (struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct az_device *az = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);
az->curfreq = f->frequency;
az_setfreq(az, az->curfreq);
......@@ -276,8 +274,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
static int vidioc_g_frequency (struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct az_device *az = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = az->curfreq;
......@@ -303,8 +300,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
static int vidioc_g_ctrl (struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct az_device *az = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -323,8 +319,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
static int vidioc_s_ctrl (struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct az_device *az = video_get_drvdata(dev);
struct az_device *az = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -204,8 +204,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct gemtek_pci_card *card = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -232,8 +231,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct gemtek_pci_card *card = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);
if ( (f->frequency < GEMTEK_PCI_RANGE_LOW) ||
(f->frequency > GEMTEK_PCI_RANGE_HIGH) )
......@@ -247,8 +245,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct gemtek_pci_card *card = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = card->current_frequency;
......@@ -272,8 +269,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct gemtek_pci_card *card = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -292,8 +288,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct gemtek_pci_card *card = video_get_drvdata(dev);
struct gemtek_pci_card *card = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -459,8 +459,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct gemtek_device *rt = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);
gemtek_setfreq(rt, f->frequency);
......@@ -470,8 +469,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct gemtek_device *rt = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = rt->lastfreq;
......@@ -495,8 +493,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct gemtek_device *rt = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -515,8 +512,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct gemtek_device *rt = video_get_drvdata(dev);
struct gemtek_device *rt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -210,8 +210,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -243,8 +242,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
if (f->frequency < FREQ_LO || f->frequency > FREQ_HI)
return -EINVAL;
......@@ -255,8 +253,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = BITS2FREQ(radio_bits_get(card));
......@@ -281,8 +278,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -295,8 +291,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
register u16 io = card->io;
register u16 omask = inw(io + IO_MASK);
......
......@@ -231,8 +231,7 @@ static int vidioc_querycap (struct file *file, void *priv,
static int vidioc_g_tuner (struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -302,8 +301,7 @@ static int vidioc_s_audio (struct file *file, void *priv,
static int vidioc_s_frequency (struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) {
dprintk(1, "radio freq (%d.%02d MHz) out of range (%d-%d)\n",
......@@ -324,8 +322,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
static int vidioc_g_frequency (struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = card->freq;
......@@ -355,8 +352,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
static int vidioc_g_ctrl (struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -370,8 +366,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
static int vidioc_s_ctrl (struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct radio_device *card = video_get_drvdata(dev);
struct radio_device *card = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -154,8 +154,7 @@ static int rt_getsigstr(struct rt_device *dev)
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -174,8 +173,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
rt->curfreq = f->frequency;
rt_setfreq(rt, rt->curfreq);
......@@ -185,8 +183,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = rt->curfreq;
......@@ -211,8 +208,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -231,8 +227,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct rt_device *rt = video_get_drvdata(dev);
struct rt_device *rt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -147,8 +147,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
int mult;
struct video_device *dev = video_devdata(file);
struct fmi_device *fmi = video_get_drvdata(dev);
struct fmi_device *fmi = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -176,8 +175,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct fmi_device *fmi = video_get_drvdata(dev);
struct fmi_device *fmi = video_drvdata(file);
if (!(fmi->flags & V4L2_TUNER_CAP_LOW))
f->frequency *= 1000;
......@@ -194,8 +192,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct fmi_device *fmi = video_get_drvdata(dev);
struct fmi_device *fmi = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = fmi->curfreq;
......@@ -222,8 +219,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct fmi_device *fmi = video_get_drvdata(dev);
struct fmi_device *fmi = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -236,8 +232,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct fmi_device *fmi = video_get_drvdata(dev);
struct fmi_device *fmi = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -230,8 +230,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
int mult;
struct video_device *dev = video_devdata(file);
struct fmr2_device *fmr2 = video_get_drvdata(dev);
struct fmr2_device *fmr2 = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -263,8 +262,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct fmr2_device *fmr2 = video_get_drvdata(dev);
struct fmr2_device *fmr2 = video_drvdata(file);
if (!(fmr2->flags & V4L2_TUNER_CAP_LOW))
f->frequency *= 1000;
......@@ -287,8 +285,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct fmr2_device *fmr2 = video_get_drvdata(dev);
struct fmr2_device *fmr2 = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = fmr2->curfreq;
......@@ -314,8 +311,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct fmr2_device *fmr2 = video_get_drvdata(dev);
struct fmr2_device *fmr2 = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -331,8 +327,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct fmr2_device *fmr2 = video_get_drvdata(dev);
struct fmr2_device *fmr2 = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -986,7 +986,7 @@ static void si470x_work(struct work_struct *work)
static ssize_t si470x_fops_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
unsigned int block_count = 0;
......@@ -1047,7 +1047,7 @@ static ssize_t si470x_fops_read(struct file *file, char __user *buf,
static unsigned int si470x_fops_poll(struct file *file,
struct poll_table_struct *pts)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* switch on rds reception */
......@@ -1071,7 +1071,7 @@ static unsigned int si470x_fops_poll(struct file *file,
*/
static int si470x_fops_open(struct inode *inode, struct file *file)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval;
lock_kernel();
......@@ -1101,7 +1101,7 @@ static int si470x_fops_open(struct inode *inode, struct file *file)
*/
static int si470x_fops_release(struct inode *inode, struct file *file)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety check */
......@@ -1284,7 +1284,7 @@ static int si470x_vidioc_queryctrl(struct file *file, void *priv,
static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety checks */
......@@ -1320,7 +1320,7 @@ static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety checks */
......@@ -1407,7 +1407,7 @@ static int si470x_vidioc_s_audio(struct file *file, void *priv,
static int si470x_vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *tuner)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety checks */
......@@ -1473,7 +1473,7 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
static int si470x_vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *tuner)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety checks */
......@@ -1507,7 +1507,7 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv,
static int si470x_vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *freq)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety checks */
......@@ -1536,7 +1536,7 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
static int si470x_vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *freq)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety checks */
......@@ -1565,7 +1565,7 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv,
static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
struct v4l2_hw_freq_seek *seek)
{
struct si470x_device *radio = video_get_drvdata(video_devdata(file));
struct si470x_device *radio = video_drvdata(file);
int retval = 0;
/* safety checks */
......
......@@ -221,8 +221,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct tt_device *tt = video_get_drvdata(dev);
struct tt_device *tt = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -249,8 +248,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct tt_device *tt = video_get_drvdata(dev);
struct tt_device *tt = video_drvdata(file);
tt->curfreq = f->frequency;
tt_setfreq(tt, tt->curfreq);
......@@ -260,8 +258,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct tt_device *tt = video_get_drvdata(dev);
struct tt_device *tt = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = tt->curfreq;
......@@ -286,8 +283,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct tt_device *tt = video_get_drvdata(dev);
struct tt_device *tt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -306,8 +302,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct tt_device *tt = video_get_drvdata(dev);
struct tt_device *tt = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -223,8 +223,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct typhoon_device *typhoon = video_get_drvdata(dev);
struct typhoon_device *typhoon = video_drvdata(file);
typhoon->curfreq = f->frequency;
typhoon_setfreq(typhoon, typhoon->curfreq);
......@@ -234,8 +233,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct typhoon_device *typhoon = video_get_drvdata(dev);
struct typhoon_device *typhoon = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = typhoon->curfreq;
......@@ -261,8 +259,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct typhoon_device *typhoon = video_get_drvdata(dev);
struct typhoon_device *typhoon = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -278,8 +275,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl (struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct typhoon_device *typhoon = video_get_drvdata(dev);
struct typhoon_device *typhoon = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -246,8 +246,7 @@ static int vidioc_querycap(struct file *file, void *priv,
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
struct video_device *dev = video_devdata(file);
struct zol_device *zol = video_get_drvdata(dev);
struct zol_device *zol = video_drvdata(file);
if (v->index > 0)
return -EINVAL;
......@@ -277,8 +276,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct zol_device *zol = video_get_drvdata(dev);
struct zol_device *zol = video_drvdata(file);
zol->curfreq = f->frequency;
zol_setfreq(zol, zol->curfreq);
......@@ -288,8 +286,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
struct video_device *dev = video_devdata(file);
struct zol_device *zol = video_get_drvdata(dev);
struct zol_device *zol = video_drvdata(file);
f->type = V4L2_TUNER_RADIO;
f->frequency = zol->curfreq;
......@@ -314,8 +311,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct zol_device *zol = video_get_drvdata(dev);
struct zol_device *zol = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......@@ -331,8 +327,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
struct video_device *dev = video_devdata(file);
struct zol_device *zol = video_get_drvdata(dev);
struct zol_device *zol = video_drvdata(file);
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:
......
......@@ -241,8 +241,7 @@ static struct v4l2_queryctrl controls[] = {
*****************************************************************************/
static int cpia2_open(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct camera_data *cam = video_get_drvdata(dev);
struct camera_data *cam = video_drvdata(file);
int retval = 0;
if (!cam) {
......@@ -357,8 +356,7 @@ static int cpia2_close(struct inode *inode, struct file *file)
static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count,
loff_t *off)
{
struct video_device *dev = video_devdata(file);
struct camera_data *cam = video_get_drvdata(dev);
struct camera_data *cam = video_drvdata(file);
int noblock = file->f_flags&O_NONBLOCK;
struct cpia2_fh *fh = file->private_data;
......@@ -382,9 +380,7 @@ static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count,
*****************************************************************************/
static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait)
{
struct video_device *dev = video_devdata(filp);
struct camera_data *cam = video_get_drvdata(dev);
struct camera_data *cam = video_drvdata(filp);
struct cpia2_fh *fh = filp->private_data;
if(!cam)
......@@ -1579,8 +1575,7 @@ static int ioctl_dqbuf(void *arg,struct camera_data *cam, struct file *file)
static int cpia2_do_ioctl(struct inode *inode, struct file *file,
unsigned int ioctl_nr, void *arg)
{
struct video_device *dev = video_devdata(file);
struct camera_data *cam = video_get_drvdata(dev);
struct camera_data *cam = video_drvdata(file);
int retval = 0;
if (!cam)
......@@ -1860,9 +1855,8 @@ static int cpia2_ioctl(struct inode *inode, struct file *file,
*****************************************************************************/
static int cpia2_mmap(struct file *file, struct vm_area_struct *area)
{
struct camera_data *cam = video_drvdata(file);
int retval;
struct video_device *dev = video_devdata(file);
struct camera_data *cam = video_get_drvdata(dev);
/* Priority check */
struct cpia2_fh *fh = file->private_data;
......
......@@ -1214,7 +1214,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
if (!down_read_trylock(&et61x251_dev_lock))
return -ERESTARTSYS;
cam = video_get_drvdata(video_devdata(filp));
cam = video_drvdata(filp);
if (wait_for_completion_interruptible(&cam->probe)) {
up_read(&et61x251_dev_lock);
......@@ -1297,7 +1297,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
down_write(&et61x251_dev_lock);
cam = video_get_drvdata(video_devdata(filp));
cam = video_drvdata(filp);
et61x251_stop_transfer(cam);
et61x251_release_buffers(cam);
......@@ -1318,7 +1318,7 @@ static ssize_t
et61x251_read(struct file* filp, char __user * buf,
size_t count, loff_t* f_pos)
{
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
struct et61x251_device *cam = video_drvdata(filp);
struct et61x251_frame_t* f, * i;
unsigned long lock_flags;
long timeout;
......@@ -1426,7 +1426,7 @@ et61x251_read(struct file* filp, char __user * buf,
static unsigned int et61x251_poll(struct file *filp, poll_table *wait)
{
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
struct et61x251_device *cam = video_drvdata(filp);
struct et61x251_frame_t* f;
unsigned long lock_flags;
unsigned int mask = 0;
......@@ -1502,7 +1502,7 @@ static struct vm_operations_struct et61x251_vm_ops = {
static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma)
{
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
struct et61x251_device *cam = video_drvdata(filp);
unsigned long size = vma->vm_end - vma->vm_start,
start = vma->vm_start;
void *pos;
......@@ -2395,7 +2395,7 @@ et61x251_vidioc_s_parm(struct et61x251_device* cam, void __user * arg)
static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
unsigned int cmd, void __user * arg)
{
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
struct et61x251_device *cam = video_drvdata(filp);
switch (cmd) {
......@@ -2490,7 +2490,7 @@ static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
static int et61x251_ioctl(struct inode* inode, struct file* filp,
unsigned int cmd, unsigned long arg)
{
struct et61x251_device* cam = video_get_drvdata(video_devdata(filp));
struct et61x251_device *cam = video_drvdata(filp);
int err = 0;
if (mutex_lock_interruptible(&cam->fileop_mutex))
......
......@@ -149,6 +149,7 @@ static int saa5246a_probe(struct i2c_adapter *adap)
static int saa5246a_detach(struct i2c_client *client)
{
struct video_device *vd = i2c_get_clientdata(client);
i2c_detach_client(client);
video_unregister_device(vd);
kfree(video_get_drvdata(vd));
......@@ -581,8 +582,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t,
static int do_saa5246a_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
struct video_device *vd = video_devdata(file);
struct saa5246a_device *t = video_get_drvdata(vd);
struct saa5246a_device *t = video_drvdata(file);
switch(cmd)
{
......@@ -723,8 +723,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
static int saa5246a_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct video_device *vd = video_devdata(file);
struct saa5246a_device *t = video_get_drvdata(vd);
struct saa5246a_device *t = video_drvdata(file);
int err;
cmd = vtx_fix_command(cmd);
......@@ -736,8 +735,7 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file,
static int saa5246a_open(struct inode *inode, struct file *file)
{
struct video_device *vd = video_devdata(file);
struct saa5246a_device *t = video_get_drvdata(vd);
struct saa5246a_device *t = video_drvdata(file);
if (t->client == NULL)
return -ENODEV;
......@@ -779,8 +777,7 @@ static int saa5246a_open(struct inode *inode, struct file *file)
static int saa5246a_release(struct inode *inode, struct file *file)
{
struct video_device *vd = video_devdata(file);
struct saa5246a_device *t = video_get_drvdata(vd);
struct saa5246a_device *t = video_drvdata(file);
/* Stop all acquisition circuits. */
i2c_senddata(t, SAA5246A_REGISTER_R1,
......
......@@ -319,8 +319,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
static int virtual_mode = false;
struct video_device *vd = video_devdata(file);
struct saa5249_device *t = video_get_drvdata(vd);
struct saa5249_device *t = video_drvdata(file);
switch(cmd)
{
......@@ -618,8 +617,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
static int saa5249_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct video_device *vd = video_devdata(file);
struct saa5249_device *t = video_get_drvdata(vd);
struct saa5249_device *t = video_drvdata(file);
int err;
cmd = vtx_fix_command(cmd);
......@@ -631,8 +629,7 @@ static int saa5249_ioctl(struct inode *inode, struct file *file,
static int saa5249_open(struct inode *inode, struct file *file)
{
struct video_device *vd = video_devdata(file);
struct saa5249_device *t = video_get_drvdata(vd);
struct saa5249_device *t = video_drvdata(file);
int pgbuf;
if (t->client == NULL)
......@@ -669,8 +666,7 @@ static int saa5249_open(struct inode *inode, struct file *file)
static int saa5249_release(struct inode *inode, struct file *file)
{
struct video_device *vd = video_devdata(file);
struct saa5249_device *t = video_get_drvdata(vd);
struct saa5249_device *t = video_drvdata(file);
i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */
i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */
......
......@@ -1746,7 +1746,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
if (!down_read_trylock(&sn9c102_dev_lock))
return -ERESTARTSYS;
cam = video_get_drvdata(video_devdata(filp));
cam = video_drvdata(filp);
if (wait_for_completion_interruptible(&cam->probe)) {
up_read(&sn9c102_dev_lock);
......@@ -1843,7 +1843,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
down_write(&sn9c102_dev_lock);
cam = video_get_drvdata(video_devdata(filp));
cam = video_drvdata(filp);
sn9c102_stop_transfer(cam);
sn9c102_release_buffers(cam);
......@@ -1863,7 +1863,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
static ssize_t
sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
{
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
struct sn9c102_device *cam = video_drvdata(filp);
struct sn9c102_frame_t* f, * i;
unsigned long lock_flags;
long timeout;
......@@ -1987,7 +1987,7 @@ sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
static unsigned int sn9c102_poll(struct file *filp, poll_table *wait)
{
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
struct sn9c102_device *cam = video_drvdata(filp);
struct sn9c102_frame_t* f;
unsigned long lock_flags;
unsigned int mask = 0;
......@@ -2063,7 +2063,7 @@ static struct vm_operations_struct sn9c102_vm_ops = {
static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma)
{
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
struct sn9c102_device *cam = video_drvdata(filp);
unsigned long size = vma->vm_end - vma->vm_start,
start = vma->vm_start;
void *pos;
......@@ -3075,7 +3075,7 @@ sn9c102_vidioc_s_audio(struct sn9c102_device* cam, void __user * arg)
static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
unsigned int cmd, void __user * arg)
{
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
struct sn9c102_device *cam = video_drvdata(filp);
switch (cmd) {
......@@ -3179,7 +3179,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
static int sn9c102_ioctl(struct inode* inode, struct file* filp,
unsigned int cmd, unsigned long arg)
{
struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp));
struct sn9c102_device *cam = video_drvdata(filp);
int err = 0;
if (mutex_lock_interruptible(&cam->fileop_mutex))
......
......@@ -472,8 +472,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
static int
vicam_open(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct vicam_camera *cam = video_get_drvdata(dev);
struct vicam_camera *cam = video_drvdata(file);
DBG("open\n");
......
......@@ -400,15 +400,13 @@ static int uvc_has_privileges(struct uvc_fh *handle)
static int uvc_v4l2_open(struct inode *inode, struct file *file)
{
struct video_device *vdev;
struct uvc_video_device *video;
struct uvc_fh *handle;
int ret = 0;
uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_open\n");
mutex_lock(&uvc_driver.open_mutex);
vdev = video_devdata(file);
video = video_get_drvdata(vdev);
video = video_drvdata(file);
if (video->dev->state & UVC_DEV_DISCONNECTED) {
ret = -ENODEV;
......@@ -440,8 +438,7 @@ static int uvc_v4l2_open(struct inode *inode, struct file *file)
static int uvc_v4l2_release(struct inode *inode, struct file *file)
{
struct video_device *vdev = video_devdata(file);
struct uvc_video_device *video = video_get_drvdata(vdev);
struct uvc_video_device *video = video_drvdata(file);
struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_release\n");
......@@ -1031,8 +1028,7 @@ static struct vm_operations_struct uvc_vm_ops = {
static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
{
struct video_device *vdev = video_devdata(file);
struct uvc_video_device *video = video_get_drvdata(vdev);
struct uvc_video_device *video = video_drvdata(file);
struct uvc_buffer *uninitialized_var(buffer);
struct page *page;
unsigned long addr, start, size;
......@@ -1085,8 +1081,7 @@ static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait)
{
struct video_device *vdev = video_devdata(file);
struct uvc_video_device *video = video_get_drvdata(vdev);
struct uvc_video_device *video = video_drvdata(file);
uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_poll\n");
......
......@@ -4024,8 +4024,7 @@ static int vino_v4l2_s_ctrl(struct vino_channel_settings *vcs,
static int vino_open(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct vino_channel_settings *vcs = video_get_drvdata(dev);
struct vino_channel_settings *vcs = video_drvdata(file);
int ret = 0;
dprintk("open(): channel = %c\n",
(vcs->channel == VINO_CHANNEL_A) ? 'A' : 'B');
......@@ -4056,8 +4055,7 @@ static int vino_open(struct inode *inode, struct file *file)
static int vino_close(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct vino_channel_settings *vcs = video_get_drvdata(dev);
struct vino_channel_settings *vcs = video_drvdata(file);
dprintk("close():\n");
mutex_lock(&vcs->mutex);
......@@ -4100,8 +4098,7 @@ static struct vm_operations_struct vino_vm_ops = {
static int vino_mmap(struct file *file, struct vm_area_struct *vma)
{
struct video_device *dev = video_devdata(file);
struct vino_channel_settings *vcs = video_get_drvdata(dev);
struct vino_channel_settings *vcs = video_drvdata(file);
unsigned long start = vma->vm_start;
unsigned long size = vma->vm_end - vma->vm_start;
......@@ -4206,8 +4203,7 @@ static int vino_mmap(struct file *file, struct vm_area_struct *vma)
static unsigned int vino_poll(struct file *file, poll_table *pt)
{
struct video_device *dev = video_devdata(file);
struct vino_channel_settings *vcs = video_get_drvdata(dev);
struct vino_channel_settings *vcs = video_drvdata(file);
unsigned int outgoing;
unsigned int ret = 0;
......@@ -4247,8 +4243,7 @@ static unsigned int vino_poll(struct file *file, poll_table *pt)
static int vino_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
struct video_device *dev = video_devdata(file);
struct vino_channel_settings *vcs = video_get_drvdata(dev);
struct vino_channel_settings *vcs = video_drvdata(file);
#ifdef VINO_DEBUG
switch (_IOC_TYPE(cmd)) {
......@@ -4355,8 +4350,7 @@ static int vino_do_ioctl(struct inode *inode, struct file *file,
static int vino_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
struct video_device *dev = video_devdata(file);
struct vino_channel_settings *vcs = video_get_drvdata(dev);
struct vino_channel_settings *vcs = video_drvdata(file);
int ret;
if (mutex_lock_interruptible(&vcs->mutex))
......
......@@ -187,16 +187,14 @@ static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
static int w9966_exclusive_open(struct inode *inode, struct file *file)
{
struct video_device *vdev = video_devdata(file);
struct w9966_dev *cam = video_get_drvdata(vdev);
struct w9966_dev *cam = video_drvdata(file);
return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0;
}
static int w9966_exclusive_release(struct inode *inode, struct file *file)
{
struct video_device *vdev = video_devdata(file);
struct w9966_dev *cam = video_get_drvdata(vdev);
struct w9966_dev *cam = video_drvdata(file);
clear_bit(0, &cam->in_use);
return 0;
......@@ -732,8 +730,7 @@ static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data)
static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
struct video_device *vdev = video_devdata(file);
struct w9966_dev *cam = video_get_drvdata(vdev);
struct w9966_dev *cam = video_drvdata(file);
switch(cmd)
{
......@@ -891,8 +888,7 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct video_device *vdev = video_devdata(file);
struct w9966_dev *cam = video_get_drvdata(vdev);
struct w9966_dev *cam = video_drvdata(file);
unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000
unsigned char __user *dest = (unsigned char __user *)buf;
unsigned long dleft = count;
......
......@@ -657,7 +657,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
if (!down_read_trylock(&zc0301_dev_lock))
return -EAGAIN;
cam = video_get_drvdata(video_devdata(filp));
cam = video_drvdata(filp);
if (wait_for_completion_interruptible(&cam->probe)) {
up_read(&zc0301_dev_lock);
......@@ -739,7 +739,7 @@ static int zc0301_release(struct inode* inode, struct file* filp)
down_write(&zc0301_dev_lock);
cam = video_get_drvdata(video_devdata(filp));
cam = video_drvdata(filp);
zc0301_stop_transfer(cam);
zc0301_release_buffers(cam);
......@@ -759,7 +759,7 @@ static int zc0301_release(struct inode* inode, struct file* filp)
static ssize_t
zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
{
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
struct zc0301_device *cam = video_drvdata(filp);
struct zc0301_frame_t* f, * i;
unsigned long lock_flags;
long timeout;
......@@ -866,7 +866,7 @@ zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
static unsigned int zc0301_poll(struct file *filp, poll_table *wait)
{
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
struct zc0301_device *cam = video_drvdata(filp);
struct zc0301_frame_t* f;
unsigned long lock_flags;
unsigned int mask = 0;
......@@ -941,7 +941,7 @@ static struct vm_operations_struct zc0301_vm_ops = {
static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma)
{
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
struct zc0301_device *cam = video_drvdata(filp);
unsigned long size = vma->vm_end - vma->vm_start,
start = vma->vm_start;
void *pos;
......@@ -1796,7 +1796,7 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg)
static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
unsigned int cmd, void __user * arg)
{
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
struct zc0301_device *cam = video_drvdata(filp);
switch (cmd) {
......@@ -1891,7 +1891,7 @@ static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
static int zc0301_ioctl(struct inode* inode, struct file* filp,
unsigned int cmd, unsigned long arg)
{
struct zc0301_device* cam = video_get_drvdata(video_devdata(filp));
struct zc0301_device *cam = video_drvdata(filp);
int err = 0;
if (mutex_lock_interruptible(&cam->fileop_mutex))
......
......@@ -87,8 +87,7 @@ static void snd_tea575x_set_freq(struct snd_tea575x *tea)
static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long data)
{
struct video_device *dev = video_devdata(file);
struct snd_tea575x *tea = video_get_drvdata(dev);
struct snd_tea575x *tea = video_drvdata(file);
void __user *arg = (void __user *)data;
switch(cmd) {
......@@ -177,16 +176,14 @@ static void snd_tea575x_release(struct video_device *vfd)
static int snd_tea575x_exclusive_open(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct snd_tea575x *tea = video_get_drvdata(dev);
struct snd_tea575x *tea = video_drvdata(file);
return test_and_set_bit(0, &tea->in_use) ? -EBUSY : 0;
}
static int snd_tea575x_exclusive_release(struct inode *inode, struct file *file)
{
struct video_device *dev = video_devdata(file);
struct snd_tea575x *tea = video_get_drvdata(dev);
struct snd_tea575x *tea = video_drvdata(file);
clear_bit(0, &tea->in_use);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment