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