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

media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO

'GRABBER' is a weird name, all other types map to the /dev
device names. Rename to 'VIDEO' to be consistent with the
other types.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent e653614e
...@@ -1042,7 +1042,7 @@ static int au0828_v4l2_close(struct file *filp) ...@@ -1042,7 +1042,7 @@ static int au0828_v4l2_close(struct file *filp)
dev->streaming_users, dev->users); dev->streaming_users, dev->users);
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
if (vdev->vfl_type == VFL_TYPE_GRABBER && dev->vid_timeout_running) { if (vdev->vfl_type == VFL_TYPE_VIDEO && dev->vid_timeout_running) {
/* Cancel timeout thread in case they didn't call streamoff */ /* Cancel timeout thread in case they didn't call streamoff */
dev->vid_timeout_running = 0; dev->vid_timeout_running = 0;
del_timer_sync(&dev->vid_timeout); del_timer_sync(&dev->vid_timeout);
...@@ -2007,7 +2007,7 @@ int au0828_analog_register(struct au0828_dev *dev, ...@@ -2007,7 +2007,7 @@ int au0828_analog_register(struct au0828_dev *dev,
/* Register the v4l2 device */ /* Register the v4l2 device */
video_set_drvdata(&dev->vdev, dev); video_set_drvdata(&dev->vdev, dev);
retval = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); retval = video_register_device(&dev->vdev, VFL_TYPE_VIDEO, -1);
if (retval != 0) { if (retval != 0) {
dprintk(1, "unable to register video device (error = %d).\n", dprintk(1, "unable to register video device (error = %d).\n",
retval); retval);
......
...@@ -1134,7 +1134,7 @@ int cpia2_register_camera(struct camera_data *cam) ...@@ -1134,7 +1134,7 @@ int cpia2_register_camera(struct camera_data *cam)
reset_camera_struct_v4l(cam); reset_camera_struct_v4l(cam);
/* register v4l device */ /* register v4l device */
if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { if (video_register_device(&cam->vdev, VFL_TYPE_VIDEO, video_nr) < 0) {
ERR("video_register_device failed\n"); ERR("video_register_device failed\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -1790,7 +1790,7 @@ int cx231xx_417_register(struct cx231xx *dev) ...@@ -1790,7 +1790,7 @@ int cx231xx_417_register(struct cx231xx *dev)
dev->v4l_device.queue = q; dev->v4l_device.queue = q;
err = video_register_device(&dev->v4l_device, err = video_register_device(&dev->v4l_device,
VFL_TYPE_GRABBER, -1); VFL_TYPE_VIDEO, -1);
if (err < 0) { if (err < 0) {
dprintk(3, "%s: can't register mpeg device\n", dev->name); dprintk(3, "%s: can't register mpeg device\n", dev->name);
v4l2_ctrl_handler_free(&dev->mpeg_ctrl_handler.hdl); v4l2_ctrl_handler_free(&dev->mpeg_ctrl_handler.hdl);
......
...@@ -1785,7 +1785,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) ...@@ -1785,7 +1785,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
dev->vdev.device_caps |= V4L2_CAP_TUNER; dev->vdev.device_caps |= V4L2_CAP_TUNER;
/* register v4l2 video video_device */ /* register v4l2 video video_device */
ret = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, ret = video_register_device(&dev->vdev, VFL_TYPE_VIDEO,
video_nr[dev->devno]); video_nr[dev->devno]);
if (ret) { if (ret) {
dev_err(dev->dev, dev_err(dev->dev,
......
...@@ -1223,7 +1223,7 @@ static int cxusb_medion_g_tuner(struct file *file, void *fh, ...@@ -1223,7 +1223,7 @@ static int cxusb_medion_g_tuner(struct file *file, void *fh,
if (tuner->index != 0) if (tuner->index != 0)
return -EINVAL; return -EINVAL;
if (vdev->vfl_type == VFL_TYPE_GRABBER) if (vdev->vfl_type == VFL_TYPE_VIDEO)
tuner->type = V4L2_TUNER_ANALOG_TV; tuner->type = V4L2_TUNER_ANALOG_TV;
else else
tuner->type = V4L2_TUNER_RADIO; tuner->type = V4L2_TUNER_RADIO;
...@@ -1259,7 +1259,7 @@ static int cxusb_medion_g_tuner(struct file *file, void *fh, ...@@ -1259,7 +1259,7 @@ static int cxusb_medion_g_tuner(struct file *file, void *fh,
if (ret != 0) if (ret != 0)
return ret; return ret;
if (vdev->vfl_type == VFL_TYPE_GRABBER) if (vdev->vfl_type == VFL_TYPE_VIDEO)
strscpy(tuner->name, "TV tuner", sizeof(tuner->name)); strscpy(tuner->name, "TV tuner", sizeof(tuner->name));
else else
strscpy(tuner->name, "Radio tuner", sizeof(tuner->name)); strscpy(tuner->name, "Radio tuner", sizeof(tuner->name));
...@@ -1292,7 +1292,7 @@ static int cxusb_medion_s_tuner(struct file *file, void *fh, ...@@ -1292,7 +1292,7 @@ static int cxusb_medion_s_tuner(struct file *file, void *fh,
* make sure that cx25840 is in a correct TV / radio mode, * make sure that cx25840 is in a correct TV / radio mode,
* since calls above may have changed it for tuner / IF demod * since calls above may have changed it for tuner / IF demod
*/ */
if (vdev->vfl_type == VFL_TYPE_GRABBER) if (vdev->vfl_type == VFL_TYPE_VIDEO)
v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm); v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm);
else else
v4l2_subdev_call(cxdev->cx25840, tuner, s_radio); v4l2_subdev_call(cxdev->cx25840, tuner, s_radio);
...@@ -1335,7 +1335,7 @@ static int cxusb_medion_s_frequency(struct file *file, void *fh, ...@@ -1335,7 +1335,7 @@ static int cxusb_medion_s_frequency(struct file *file, void *fh,
* make sure that cx25840 is in a correct TV / radio mode, * make sure that cx25840 is in a correct TV / radio mode,
* since calls above may have changed it for tuner / IF demod * since calls above may have changed it for tuner / IF demod
*/ */
if (vdev->vfl_type == VFL_TYPE_GRABBER) if (vdev->vfl_type == VFL_TYPE_VIDEO)
v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm); v4l2_subdev_call(cxdev->cx25840, video, s_std, cxdev->norm);
else else
v4l2_subdev_call(cxdev->cx25840, tuner, s_radio); v4l2_subdev_call(cxdev->cx25840, tuner, s_radio);
...@@ -1564,7 +1564,7 @@ static int cxusb_videoradio_release(struct file *f) ...@@ -1564,7 +1564,7 @@ static int cxusb_videoradio_release(struct file *f)
cxusb_vprintk(dvbdev, OPS, "got release\n"); cxusb_vprintk(dvbdev, OPS, "got release\n");
if (vdev->vfl_type == VFL_TYPE_GRABBER) if (vdev->vfl_type == VFL_TYPE_VIDEO)
ret = vb2_fop_release(f); ret = vb2_fop_release(f);
else else
ret = v4l2_fh_release(f); ret = v4l2_fh_release(f);
...@@ -1663,7 +1663,7 @@ static int cxusb_medion_register_analog_video(struct dvb_usb_device *dvbdev) ...@@ -1663,7 +1663,7 @@ static int cxusb_medion_register_analog_video(struct dvb_usb_device *dvbdev)
cxdev->videodev->lock = &cxdev->dev_lock; cxdev->videodev->lock = &cxdev->dev_lock;
video_set_drvdata(cxdev->videodev, dvbdev); video_set_drvdata(cxdev->videodev, dvbdev);
ret = video_register_device(cxdev->videodev, VFL_TYPE_GRABBER, -1); ret = video_register_device(cxdev->videodev, VFL_TYPE_VIDEO, -1);
if (ret) { if (ret) {
dev_err(&dvbdev->udev->dev, dev_err(&dvbdev->udev->dev,
"video device register failed, ret = %d\n", ret); "video device register failed, ret = %d\n", ret);
......
...@@ -2141,7 +2141,7 @@ static int em28xx_v4l2_open(struct file *filp) ...@@ -2141,7 +2141,7 @@ static int em28xx_v4l2_open(struct file *filp)
int ret; int ret;
switch (vdev->vfl_type) { switch (vdev->vfl_type) {
case VFL_TYPE_GRABBER: case VFL_TYPE_VIDEO:
fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
break; break;
case VFL_TYPE_VBI: case VFL_TYPE_VBI:
...@@ -2789,7 +2789,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2789,7 +2789,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
} }
/* register v4l2 video video_device */ /* register v4l2 video video_device */
ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER, ret = video_register_device(&v4l2->vdev, VFL_TYPE_VIDEO,
video_nr[dev->devno]); video_nr[dev->devno]);
if (ret) { if (ret) {
dev_err(&dev->intf->dev, dev_err(&dev->intf->dev,
......
...@@ -1138,7 +1138,7 @@ int go7007_v4l2_init(struct go7007 *go) ...@@ -1138,7 +1138,7 @@ int go7007_v4l2_init(struct go7007 *go)
go7007_s_input(go); go7007_s_input(go);
if (go->board_info->sensor_flags & GO7007_SENSOR_TV) if (go->board_info->sensor_flags & GO7007_SENSOR_TV)
go7007_s_std(go); go7007_s_std(go);
rv = video_register_device(vdev, VFL_TYPE_GRABBER, -1); rv = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
if (rv < 0) if (rv < 0)
return rv; return rv;
dev_info(go->dev, "registered device %s [v4l2]\n", dev_info(go->dev, "registered device %s [v4l2]\n",
......
...@@ -1555,7 +1555,7 @@ int gspca_dev_probe2(struct usb_interface *intf, ...@@ -1555,7 +1555,7 @@ int gspca_dev_probe2(struct usb_interface *intf,
/* init video stuff */ /* init video stuff */
ret = video_register_device(&gspca_dev->vdev, ret = video_register_device(&gspca_dev->vdev,
VFL_TYPE_GRABBER, VFL_TYPE_VIDEO,
-1); -1);
if (ret < 0) { if (ret < 0) {
pr_err("video_register_device err %d\n", ret); pr_err("video_register_device err %d\n", ret);
......
...@@ -1238,7 +1238,7 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent, ...@@ -1238,7 +1238,7 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent,
dev->video_dev.v4l2_dev = &dev->v4l2_dev; dev->video_dev.v4l2_dev = &dev->v4l2_dev;
video_set_drvdata(&dev->video_dev, dev); video_set_drvdata(&dev->video_dev, dev);
res = video_register_device(&dev->video_dev, VFL_TYPE_GRABBER, devnum); res = video_register_device(&dev->video_dev, VFL_TYPE_VIDEO, devnum);
if (res < 0) { if (res < 0) {
v4l2_err(&dev->v4l2_dev, "video_device registration failed\n"); v4l2_err(&dev->v4l2_dev, "video_device registration failed\n");
goto error; goto error;
......
...@@ -1196,7 +1196,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, ...@@ -1196,7 +1196,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
hdw = vp->channel.mc_head->hdw; hdw = vp->channel.mc_head->hdw;
dip->v4l_type = v4l_type; dip->v4l_type = v4l_type;
switch (v4l_type) { switch (v4l_type) {
case VFL_TYPE_GRABBER: case VFL_TYPE_VIDEO:
dip->stream = &vp->channel.mc_head->video_stream; dip->stream = &vp->channel.mc_head->video_stream;
dip->config = pvr2_config_mpeg; dip->config = pvr2_config_mpeg;
dip->minor_type = pvr2_v4l_type_video; dip->minor_type = pvr2_v4l_type_video;
...@@ -1276,7 +1276,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp) ...@@ -1276,7 +1276,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
/* register streams */ /* register streams */
vp->dev_video = kzalloc(sizeof(*vp->dev_video),GFP_KERNEL); vp->dev_video = kzalloc(sizeof(*vp->dev_video),GFP_KERNEL);
if (!vp->dev_video) goto fail; if (!vp->dev_video) goto fail;
pvr2_v4l2_dev_init(vp->dev_video,vp,VFL_TYPE_GRABBER); pvr2_v4l2_dev_init(vp->dev_video,vp,VFL_TYPE_VIDEO);
if (pvr2_hdw_get_input_available(vp->channel.mc_head->hdw) & if (pvr2_hdw_get_input_available(vp->channel.mc_head->hdw) &
(1 << PVR2_CVAL_INPUT_RADIO)) { (1 << PVR2_CVAL_INPUT_RADIO)) {
vp->dev_radio = kzalloc(sizeof(*vp->dev_radio),GFP_KERNEL); vp->dev_radio = kzalloc(sizeof(*vp->dev_radio),GFP_KERNEL);
......
...@@ -1116,7 +1116,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id ...@@ -1116,7 +1116,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
pdev->vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | pdev->vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
V4L2_CAP_READWRITE; V4L2_CAP_READWRITE;
rc = video_register_device(&pdev->vdev, VFL_TYPE_GRABBER, -1); rc = video_register_device(&pdev->vdev, VFL_TYPE_VIDEO, -1);
if (rc < 0) { if (rc < 0) {
PWC_ERROR("Failed to register as video device (%d).\n", rc); PWC_ERROR("Failed to register as video device (%d).\n", rc);
goto err_unregister_v4l2_dev; goto err_unregister_v4l2_dev;
......
...@@ -1649,11 +1649,11 @@ static int s2255_probe_v4l(struct s2255_dev *dev) ...@@ -1649,11 +1649,11 @@ static int s2255_probe_v4l(struct s2255_dev *dev)
video_set_drvdata(&vc->vdev, vc); video_set_drvdata(&vc->vdev, vc);
if (video_nr == -1) if (video_nr == -1)
ret = video_register_device(&vc->vdev, ret = video_register_device(&vc->vdev,
VFL_TYPE_GRABBER, VFL_TYPE_VIDEO,
video_nr); video_nr);
else else
ret = video_register_device(&vc->vdev, ret = video_register_device(&vc->vdev,
VFL_TYPE_GRABBER, VFL_TYPE_VIDEO,
cur_nr + i); cur_nr + i);
if (ret) { if (ret) {
......
...@@ -830,7 +830,7 @@ int stk1160_video_register(struct stk1160 *dev) ...@@ -830,7 +830,7 @@ int stk1160_video_register(struct stk1160 *dev)
dev->norm); dev->norm);
video_set_drvdata(&dev->vdev, dev); video_set_drvdata(&dev->vdev, dev);
rc = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); rc = video_register_device(&dev->vdev, VFL_TYPE_VIDEO, -1);
if (rc < 0) { if (rc < 0) {
stk1160_err("video_register_device failed (%d)\n", rc); stk1160_err("video_register_device failed (%d)\n", rc);
return rc; return rc;
......
...@@ -1254,7 +1254,7 @@ static int stk_register_video_device(struct stk_camera *dev) ...@@ -1254,7 +1254,7 @@ static int stk_register_video_device(struct stk_camera *dev)
dev->vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | dev->vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING; V4L2_CAP_STREAMING;
video_set_drvdata(&dev->vdev, dev); video_set_drvdata(&dev->vdev, dev);
err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); err = video_register_device(&dev->vdev, VFL_TYPE_VIDEO, -1);
if (err) if (err)
pr_err("v4l registration failed\n"); pr_err("v4l registration failed\n");
else else
......
...@@ -1300,7 +1300,7 @@ static int __tm6000_open(struct file *file) ...@@ -1300,7 +1300,7 @@ static int __tm6000_open(struct file *file)
video_device_node_name(vdev)); video_device_node_name(vdev));
switch (vdev->vfl_type) { switch (vdev->vfl_type) {
case VFL_TYPE_GRABBER: case VFL_TYPE_VIDEO:
type = V4L2_BUF_TYPE_VIDEO_CAPTURE; type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
break; break;
case VFL_TYPE_VBI: case VFL_TYPE_VBI:
...@@ -1639,7 +1639,7 @@ int tm6000_v4l2_register(struct tm6000_core *dev) ...@@ -1639,7 +1639,7 @@ int tm6000_v4l2_register(struct tm6000_core *dev)
INIT_LIST_HEAD(&dev->vidq.active); INIT_LIST_HEAD(&dev->vidq.active);
INIT_LIST_HEAD(&dev->vidq.queued); INIT_LIST_HEAD(&dev->vidq.queued);
ret = video_register_device(&dev->vfd, VFL_TYPE_GRABBER, video_nr); ret = video_register_device(&dev->vfd, VFL_TYPE_VIDEO, video_nr);
if (ret < 0) { if (ret < 0) {
printk(KERN_INFO "%s: can't register video device\n", printk(KERN_INFO "%s: can't register video device\n",
......
...@@ -941,7 +941,7 @@ int usbtv_video_init(struct usbtv *usbtv) ...@@ -941,7 +941,7 @@ int usbtv_video_init(struct usbtv *usbtv)
usbtv->vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | usbtv->vdev.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING; V4L2_CAP_STREAMING;
video_set_drvdata(&usbtv->vdev, usbtv); video_set_drvdata(&usbtv->vdev, usbtv);
ret = video_register_device(&usbtv->vdev, VFL_TYPE_GRABBER, -1); ret = video_register_device(&usbtv->vdev, VFL_TYPE_VIDEO, -1);
if (ret < 0) { if (ret < 0) {
dev_warn(usbtv->dev, "Could not register video device\n"); dev_warn(usbtv->dev, "Could not register video device\n");
goto vdev_fail; goto vdev_fail;
......
...@@ -1271,7 +1271,7 @@ static int usbvision_register_video(struct usb_usbvision *usbvision) ...@@ -1271,7 +1271,7 @@ static int usbvision_register_video(struct usb_usbvision *usbvision)
if (usbvision->have_tuner) if (usbvision->have_tuner)
usbvision->vdev.device_caps |= V4L2_CAP_TUNER; usbvision->vdev.device_caps |= V4L2_CAP_TUNER;
if (video_register_device(&usbvision->vdev, VFL_TYPE_GRABBER, video_nr) < 0) if (video_register_device(&usbvision->vdev, VFL_TYPE_VIDEO, video_nr) < 0)
goto err_exit; goto err_exit;
printk(KERN_INFO "USBVision[%d]: registered USBVision Video device %s [v4l2]\n", printk(KERN_INFO "USBVision[%d]: registered USBVision Video device %s [v4l2]\n",
usbvision->nr, video_device_node_name(&usbvision->vdev)); usbvision->nr, video_device_node_name(&usbvision->vdev));
......
...@@ -2014,7 +2014,7 @@ int uvc_register_video_device(struct uvc_device *dev, ...@@ -2014,7 +2014,7 @@ int uvc_register_video_device(struct uvc_device *dev,
*/ */
video_set_drvdata(vdev, stream); video_set_drvdata(vdev, stream);
ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1); ret = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
if (ret < 0) { if (ret < 0) {
uvc_printk(KERN_ERR, "Failed to register %s device (%d).\n", uvc_printk(KERN_ERR, "Failed to register %s device (%d).\n",
v4l2_type_names[type], ret); v4l2_type_names[type], ret);
......
...@@ -1516,7 +1516,7 @@ static int zr364xx_probe(struct usb_interface *intf, ...@@ -1516,7 +1516,7 @@ static int zr364xx_probe(struct usb_interface *intf,
V4L2_FIELD_NONE, V4L2_FIELD_NONE,
sizeof(struct zr364xx_buffer), cam, &cam->lock); sizeof(struct zr364xx_buffer), cam, &cam->lock);
err = video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1); err = video_register_device(&cam->vdev, VFL_TYPE_VIDEO, -1);
if (err) { if (err) {
dev_err(&udev->dev, "video_register_device failed\n"); dev_err(&udev->dev, "video_register_device failed\n");
goto fail; goto fail;
......
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