Skip to content

Commit

Permalink
V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from vid…
Browse files Browse the repository at this point in the history
…eo_device

The type and type2 fields were unused and so could be removed.
Instead add a vfl_type field that contains the type of the video
device.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 27, 2008
1 parent c52e4f5 commit 0ea6bc8
Show file tree
Hide file tree
Showing 64 changed files with 14 additions and 124 deletions.
2 changes: 1 addition & 1 deletion drivers/media/common/saa7146_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev

DEB_EE(("dev:%p\n",dev));

if( VFL_TYPE_GRABBER == (*vid)->type ) {
if ((*vid)->vfl_type == VFL_TYPE_GRABBER) {
vv->video_minor = -1;
} else {
vv->vbi_minor = -1;
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/dsbr100.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ static const struct v4l2_ioctl_ops usb_dsbr100_ioctl_ops = {
/* V4L2 interface */
static struct video_device dsbr100_videodev_template = {
.name = "D-Link DSB-R 100",
.type = VID_TYPE_TUNER,
.fops = &usb_dsbr100_fops,
.ioctl_ops = &usb_dsbr100_ioctl_ops,
.release = video_device_release,
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/miropcm20-radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ static const struct file_operations pcm20_fops = {

static struct video_device pcm20_radio = {
.name = "Miro PCM 20 radio",
.type = VID_TYPE_TUNER,
.fops = &pcm20_fops,
.priv = &pcm20_unit
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-aimslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ static const struct v4l2_ioctl_ops rtrack_ioctl_ops = {

static struct video_device rtrack_radio = {
.name = "RadioTrack radio",
.type = VID_TYPE_TUNER,
.fops = &rtrack_fops,
.ioctl_ops = &rtrack_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-aztech.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ static const struct v4l2_ioctl_ops aztech_ioctl_ops = {

static struct video_device aztech_radio = {
.name = "Aztech radio",
.type = VID_TYPE_TUNER,
.fops = &aztech_fops,
.ioctl_ops = &aztech_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-cadet.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ static const struct v4l2_ioctl_ops cadet_ioctl_ops = {

static struct video_device cadet_radio = {
.name = "Cadet radio",
.type = VID_TYPE_TUNER,
.fops = &cadet_fops,
.ioctl_ops = &cadet_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-gemtek-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = {

static struct video_device vdev_template = {
.name = "Gemtek PCI Radio",
.type = VID_TYPE_TUNER,
.fops = &gemtek_pci_fops,
.ioctl_ops = &gemtek_pci_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-gemtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ static const struct v4l2_ioctl_ops gemtek_ioctl_ops = {

static struct video_device gemtek_radio = {
.name = "GemTek Radio card",
.type = VID_TYPE_TUNER,
.fops = &gemtek_fops,
.ioctl_ops = &gemtek_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-maestro.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ static const struct v4l2_ioctl_ops maestro_ioctl_ops = {

static struct video_device maestro_radio = {
.name = "Maestro radio",
.type = VID_TYPE_TUNER,
.fops = &maestro_fops,
.ioctl_ops = &maestro_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-maxiradio.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ static const struct v4l2_ioctl_ops maxiradio_ioctl_ops = {

static struct video_device maxiradio_radio = {
.name = "Maxi Radio FM2000 radio",
.type = VID_TYPE_TUNER,
.fops = &maxiradio_fops,
.ioctl_ops = &maxiradio_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-rtrack2.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ static const struct v4l2_ioctl_ops rtrack2_ioctl_ops = {

static struct video_device rtrack2_radio = {
.name = "RadioTrack II radio",
.type = VID_TYPE_TUNER,
.fops = &rtrack2_fops,
.ioctl_ops = &rtrack2_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-sf16fmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ static const struct v4l2_ioctl_ops fmi_ioctl_ops = {

static struct video_device fmi_radio = {
.name = "SF16FMx radio",
.type = VID_TYPE_TUNER,
.fops = &fmi_fops,
.ioctl_ops = &fmi_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-sf16fmr2.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ static const struct v4l2_ioctl_ops fmr2_ioctl_ops = {

static struct video_device fmr2_radio = {
.name = "SF16FMR2 radio",
.type = VID_TYPE_TUNER,
.fops = &fmr2_fops,
.ioctl_ops = &fmr2_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-si470x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,6 @@ static struct video_device si470x_viddev_template = {
.fops = &si470x_fops,
.ioctl_ops = &si470x_ioctl_ops,
.name = DRIVER_NAME,
.type = VID_TYPE_TUNER,
.release = video_device_release,
};

Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-terratec.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ static const struct v4l2_ioctl_ops terratec_ioctl_ops = {

static struct video_device terratec_radio = {
.name = "TerraTec ActiveRadio",
.type = VID_TYPE_TUNER,
.fops = &terratec_fops,
.ioctl_ops = &terratec_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-trust.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ static const struct v4l2_ioctl_ops trust_ioctl_ops = {

static struct video_device trust_radio = {
.name = "Trust FM Radio",
.type = VID_TYPE_TUNER,
.fops = &trust_fops,
.ioctl_ops = &trust_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-typhoon.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ static const struct v4l2_ioctl_ops typhoon_ioctl_ops = {

static struct video_device typhoon_radio = {
.name = "Typhoon Radio",
.type = VID_TYPE_TUNER,
.fops = &typhoon_fops,
.ioctl_ops = &typhoon_ioctl_ops,
};
Expand Down
1 change: 0 additions & 1 deletion drivers/media/radio/radio-zoltrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ static const struct v4l2_ioctl_ops zoltrix_ioctl_ops = {

static struct video_device zoltrix_radio = {
.name = "Zoltrix Radio Plus",
.type = VID_TYPE_TUNER,
.fops = &zoltrix_fops,
.ioctl_ops = &zoltrix_ioctl_ops,
};
Expand Down
23 changes: 5 additions & 18 deletions drivers/media/video/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4182,8 +4182,7 @@ static irqreturn_t bttv_irq(int irq, void *dev_id)

static struct video_device *vdev_init(struct bttv *btv,
const struct video_device *template,
const char *type_name,
const int type)
const char *type_name)
{
struct video_device *vfd;

Expand All @@ -4194,7 +4193,6 @@ static struct video_device *vdev_init(struct bttv *btv,
vfd->minor = -1;
vfd->parent = &btv->c.pci->dev;
vfd->release = video_device_release;
vfd->type = type;
vfd->debug = bttv_debug;
snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)",
btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "",
Expand Down Expand Up @@ -4230,20 +4228,11 @@ static void bttv_unregister_video(struct bttv *btv)
/* register video4linux devices */
static int __devinit bttv_register_video(struct bttv *btv)
{
int video_type = VID_TYPE_CAPTURE |
VID_TYPE_TUNER |
VID_TYPE_CLIPPING|
VID_TYPE_SCALES;

if (no_overlay <= 0) {
bttv_video_template.type |= VID_TYPE_OVERLAY;
} else {
if (no_overlay > 0)
printk("bttv: Overlay support disabled.\n");
}

/* video */
btv->video_dev = vdev_init(btv, &bttv_video_template,
"video", video_type);
btv->video_dev = vdev_init(btv, &bttv_video_template, "video");

if (NULL == btv->video_dev)
goto err;
Expand All @@ -4259,8 +4248,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
}

/* vbi */
btv->vbi_dev = vdev_init(btv, &bttv_video_template,
"vbi", VID_TYPE_TUNER | VID_TYPE_TELETEXT);
btv->vbi_dev = vdev_init(btv, &bttv_video_template, "vbi");

if (NULL == btv->vbi_dev)
goto err;
Expand All @@ -4272,8 +4260,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
if (!btv->has_radio)
return 0;
/* radio */
btv->radio_dev = vdev_init(btv, &radio_template,
"radio", VID_TYPE_TUNER);
btv->radio_dev = vdev_init(btv, &radio_template, "radio");
if (NULL == btv->radio_dev)
goto err;
if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0)
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/bw-qcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,6 @@ static const struct file_operations qcam_fops = {
static struct video_device qcam_template=
{
.name = "Connectix Quickcam",
.type = VID_TYPE_CAPTURE,
.fops = &qcam_fops,
};

Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/c-qcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ static const struct file_operations qcam_fops = {
static struct video_device qcam_template=
{
.name = "Colour QuickCam",
.type = VID_TYPE_CAPTURE,
.fops = &qcam_fops,
};

Expand Down
2 changes: 0 additions & 2 deletions drivers/media/video/cafe_ccic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,8 +1794,6 @@ static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = {

static struct video_device cafe_v4l_template = {
.name = "cafe",
.type = VFL_TYPE_GRABBER,
.type2 = VID_TYPE_CAPTURE,
.minor = -1, /* Get one dynamically */
.tvnorms = V4L2_STD_NTSC_M,
.current_norm = V4L2_STD_NTSC_M, /* make mplayer happy */
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/cpia.c
Original file line number Diff line number Diff line change
Expand Up @@ -3800,7 +3800,6 @@ static const struct file_operations cpia_fops = {

static struct video_device cpia_template = {
.name = "CPiA Camera",
.type = VID_TYPE_CAPTURE,
.fops = &cpia_fops,
};

Expand Down
3 changes: 0 additions & 3 deletions drivers/media/video/cpia2/cpia2_v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,9 +1937,6 @@ static const struct file_operations fops_template = {
static struct video_device cpia2_template = {
/* I could not find any place for the old .initialize initializer?? */
.name= "CPiA2 Camera",
.type= VID_TYPE_CAPTURE,
.type2 = V4L2_CAP_VIDEO_CAPTURE |
V4L2_CAP_STREAMING,
.minor= -1,
.fops= &fops_template,
.release= video_device_release,
Expand Down
3 changes: 0 additions & 3 deletions drivers/media/video/cx18/cx18-streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,6 @@ static int cx18_prep_dev(struct cx18 *cx, int type)
return -ENOMEM;
}

s->v4l2dev->type =
VID_TYPE_CAPTURE | VID_TYPE_TUNER | VID_TYPE_TELETEXT |
VID_TYPE_CLIPPING | VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER;
snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "cx18-%d",
cx->num);

Expand Down
4 changes: 0 additions & 4 deletions drivers/media/video/cx23885/cx23885-417.c
Original file line number Diff line number Diff line change
Expand Up @@ -1731,10 +1731,6 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {

static struct video_device cx23885_mpeg_template = {
.name = "cx23885",
.type = VID_TYPE_CAPTURE |
VID_TYPE_TUNER |
VID_TYPE_SCALES |
VID_TYPE_MPEG_ENCODER,
.fops = &mpeg_fops,
.ioctl_ops = &mpeg_ioctl_ops,
.minor = -1,
Expand Down
2 changes: 0 additions & 2 deletions drivers/media/video/cx23885/cx23885-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
static struct video_device cx23885_vbi_template;
static struct video_device cx23885_video_template = {
.name = "cx23885-video",
.type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES,
.fops = &video_fops,
.minor = -1,
.ioctl_ops = &video_ioctl_ops,
Expand Down Expand Up @@ -1517,7 +1516,6 @@ int cx23885_video_register(struct cx23885_dev *dev)
memcpy(&cx23885_vbi_template, &cx23885_video_template,
sizeof(cx23885_vbi_template));
strcpy(cx23885_vbi_template.name, "cx23885-vbi");
cx23885_vbi_template.type = VID_TYPE_TELETEXT|VID_TYPE_TUNER;

dev->tvnorm = cx23885_video_template.current_norm;

Expand Down
2 changes: 0 additions & 2 deletions drivers/media/video/cx88/cx88-blackbird.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,6 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {

static struct video_device cx8802_mpeg_template = {
.name = "cx8802",
.type = VID_TYPE_CAPTURE | VID_TYPE_TUNER |
VID_TYPE_SCALES | VID_TYPE_MPEG_ENCODER,
.fops = &mpeg_fops,
.ioctl_ops = &mpeg_ioctl_ops,
.minor = -1,
Expand Down
3 changes: 0 additions & 3 deletions drivers/media/video/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,6 @@ static struct video_device cx8800_vbi_template;

static struct video_device cx8800_video_template = {
.name = "cx8800-video",
.type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES,
.fops = &video_fops,
.minor = -1,
.ioctl_ops = &video_ioctl_ops,
Expand Down Expand Up @@ -1761,7 +1760,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = {

static struct video_device cx8800_radio_template = {
.name = "cx8800-radio",
.type = VID_TYPE_TUNER,
.fops = &radio_fops,
.minor = -1,
.ioctl_ops = &radio_ioctl_ops,
Expand Down Expand Up @@ -1838,7 +1836,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
memcpy( &cx8800_vbi_template, &cx8800_video_template,
sizeof(cx8800_vbi_template) );
strcpy(cx8800_vbi_template.name,"cx8800-vbi");
cx8800_vbi_template.type = VID_TYPE_TELETEXT|VID_TYPE_TUNER;

/* initialize driver struct */
spin_lock_init(&dev->slock);
Expand Down
14 changes: 3 additions & 11 deletions drivers/media/video/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = {

static struct video_device em28xx_radio_template = {
.name = "em28xx-radio",
.type = VID_TYPE_TUNER,
.fops = &radio_fops,
.ioctl_ops = &radio_ioctl_ops,
.minor = -1,
Expand Down Expand Up @@ -1891,7 +1890,6 @@ EXPORT_SYMBOL(em28xx_unregister_extension);

static struct video_device *em28xx_vdev_init(struct em28xx *dev,
const struct video_device *template,
const int type,
const char *type_name)
{
struct video_device *vfd;
Expand All @@ -1903,7 +1901,6 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev,
vfd->minor = -1;
vfd->parent = &dev->udev->dev;
vfd->release = video_device_release;
vfd->type = type;
vfd->debug = video_debug;

snprintf(vfd->name, sizeof(vfd->name), "%s %s",
Expand Down Expand Up @@ -1981,14 +1978,11 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
list_add_tail(&dev->devlist, &em28xx_devlist);

/* allocate and fill video video_device struct */
dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template,
VID_TYPE_CAPTURE, "video");
dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video");
if (NULL == dev->vdev) {
em28xx_errdev("cannot allocate video_device.\n");
goto fail_unreg;
}
if (dev->tuner_type != TUNER_ABSENT)
dev->vdev->type |= VID_TYPE_TUNER;

/* register v4l2 video video_device */
retval = video_register_device(dev->vdev, VFL_TYPE_GRABBER,
Expand All @@ -2000,8 +1994,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
}

/* Allocate and fill vbi video_device struct */
dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template,
VFL_TYPE_VBI, "vbi");
dev->vbi_dev = em28xx_vdev_init(dev, &em28xx_video_template, "vbi");
/* register v4l2 vbi video_device */
if (video_register_device(dev->vbi_dev, VFL_TYPE_VBI,
vbi_nr[dev->devno]) < 0) {
Expand All @@ -2011,8 +2004,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
}

if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) {
dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template,
VFL_TYPE_RADIO, "radio");
dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, "radio");
if (NULL == dev->radio_dev) {
em28xx_errdev("cannot allocate video_device.\n");
goto fail_unreg;
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/et61x251/et61x251_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2585,7 +2585,6 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
}

strcpy(cam->v4ldev->name, "ET61X[12]51 PC Camera");
cam->v4ldev->type = VID_TYPE_CAPTURE | VID_TYPE_SCALES;
cam->v4ldev->fops = &et61x251_fops;
cam->v4ldev->minor = video_nr[dev_nr];
cam->v4ldev->release = video_device_release;
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,6 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {

static struct video_device gspca_template = {
.name = "gspca main driver",
.type = VID_TYPE_CAPTURE,
.fops = &dev_fops,
.ioctl_ops = &dev_ioctl_ops,
.release = dev_release, /* mandatory */
Expand Down
Loading

0 comments on commit 0ea6bc8

Please sign in to comment.