diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-11-27 11:57:55 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:17:58 -0500 |
commit | 327ae59757f2e56fd3fc2b11acbd0a7c4070f4e8 (patch) | |
tree | e6d1f1b18e49560349194659cfb4b30ff40da9de /drivers/media/video | |
parent | 46b21094cee16bc7e531d7d6cd66fb5ea05065d4 (diff) |
V4L/DVB (13557): v4l: Remove unneeded video_device::minor usage in drivers
The video_device::minor field is used where it shouldn't, either to
- test for error conditions that can't happen anymore with the current
v4l-dvb core,
- store the value in a driver private field that isn't used anymore,
- check the video device type where video_device::vfl_type should be
used, or
- create the name of a kernel thread that should get a stable name.
Remove or fix those use cases.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 15 | ||||
-rw-r--r-- | drivers/media/video/gspca/sn9c20x.c | 5 | ||||
-rw-r--r-- | drivers/media/video/omap24xxcam.c | 3 |
3 files changed, 8 insertions, 15 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 410260a1c364..3182a406bdd1 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -3206,7 +3206,6 @@ err: | |||
3206 | 3206 | ||
3207 | static int bttv_open(struct file *file) | 3207 | static int bttv_open(struct file *file) |
3208 | { | 3208 | { |
3209 | int minor = video_devdata(file)->minor; | ||
3210 | struct video_device *vdev = video_devdata(file); | 3209 | struct video_device *vdev = video_devdata(file); |
3211 | struct bttv *btv = video_drvdata(file); | 3210 | struct bttv *btv = video_drvdata(file); |
3212 | struct bttv_fh *fh; | 3211 | struct bttv_fh *fh; |
@@ -3214,17 +3213,17 @@ static int bttv_open(struct file *file) | |||
3214 | 3213 | ||
3215 | dprintk(KERN_DEBUG "bttv: open dev=%s\n", video_device_node_name(vdev)); | 3214 | dprintk(KERN_DEBUG "bttv: open dev=%s\n", video_device_node_name(vdev)); |
3216 | 3215 | ||
3217 | lock_kernel(); | 3216 | if (vdev->vfl_type == VFL_TYPE_GRABBER) { |
3218 | if (btv->video_dev->minor == minor) { | ||
3219 | type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 3217 | type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
3220 | } else if (btv->vbi_dev->minor == minor) { | 3218 | } else if (vdev->vfl_type == VFL_TYPE_VBI) { |
3221 | type = V4L2_BUF_TYPE_VBI_CAPTURE; | 3219 | type = V4L2_BUF_TYPE_VBI_CAPTURE; |
3222 | } else { | 3220 | } else { |
3223 | WARN_ON(1); | 3221 | WARN_ON(1); |
3224 | unlock_kernel(); | ||
3225 | return -ENODEV; | 3222 | return -ENODEV; |
3226 | } | 3223 | } |
3227 | 3224 | ||
3225 | lock_kernel(); | ||
3226 | |||
3228 | dprintk(KERN_DEBUG "bttv%d: open called (type=%s)\n", | 3227 | dprintk(KERN_DEBUG "bttv%d: open called (type=%s)\n", |
3229 | btv->c.nr,v4l2_type_names[type]); | 3228 | btv->c.nr,v4l2_type_names[type]); |
3230 | 3229 | ||
@@ -3408,7 +3407,6 @@ static struct video_device bttv_video_template = { | |||
3408 | 3407 | ||
3409 | static int radio_open(struct file *file) | 3408 | static int radio_open(struct file *file) |
3410 | { | 3409 | { |
3411 | int minor = video_devdata(file)->minor; | ||
3412 | struct video_device *vdev = video_devdata(file); | 3410 | struct video_device *vdev = video_devdata(file); |
3413 | struct bttv *btv = video_drvdata(file); | 3411 | struct bttv *btv = video_drvdata(file); |
3414 | struct bttv_fh *fh; | 3412 | struct bttv_fh *fh; |
@@ -3416,11 +3414,6 @@ static int radio_open(struct file *file) | |||
3416 | dprintk("bttv: open dev=%s\n", video_device_node_name(vdev)); | 3414 | dprintk("bttv: open dev=%s\n", video_device_node_name(vdev)); |
3417 | 3415 | ||
3418 | lock_kernel(); | 3416 | lock_kernel(); |
3419 | WARN_ON(btv->radio_dev && btv->radio_dev->minor != minor); | ||
3420 | if (!btv->radio_dev || btv->radio_dev->minor != minor) { | ||
3421 | unlock_kernel(); | ||
3422 | return -ENODEV; | ||
3423 | } | ||
3424 | 3417 | ||
3425 | dprintk("bttv%d: open called (radio)\n",btv->c.nr); | 3418 | dprintk("bttv%d: open called (radio)\n",btv->c.nr); |
3426 | 3419 | ||
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index b1944a7cbb0f..a3d8f4675c04 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -1476,8 +1476,9 @@ static int sn9c20x_input_init(struct gspca_dev *gspca_dev) | |||
1476 | if (input_register_device(sd->input_dev)) | 1476 | if (input_register_device(sd->input_dev)) |
1477 | return -EINVAL; | 1477 | return -EINVAL; |
1478 | 1478 | ||
1479 | sd->input_task = kthread_run(input_kthread, gspca_dev, "sn9c20x/%d", | 1479 | sd->input_task = kthread_run(input_kthread, gspca_dev, "sn9c20x/%s-%s", |
1480 | gspca_dev->vdev.minor); | 1480 | gspca_dev->dev->bus->bus_name, |
1481 | gspca_dev->dev->devpath); | ||
1481 | 1482 | ||
1482 | if (IS_ERR(sd->input_task)) | 1483 | if (IS_ERR(sd->input_task)) |
1483 | return -EINVAL; | 1484 | return -EINVAL; |
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c index 71e08be7960c..7400eacb4d64 100644 --- a/drivers/media/video/omap24xxcam.c +++ b/drivers/media/video/omap24xxcam.c | |||
@@ -1450,12 +1450,11 @@ static int omap24xxcam_mmap(struct file *file, struct vm_area_struct *vma) | |||
1450 | 1450 | ||
1451 | static int omap24xxcam_open(struct file *file) | 1451 | static int omap24xxcam_open(struct file *file) |
1452 | { | 1452 | { |
1453 | int minor = video_devdata(file)->minor; | ||
1454 | struct omap24xxcam_device *cam = omap24xxcam.priv; | 1453 | struct omap24xxcam_device *cam = omap24xxcam.priv; |
1455 | struct omap24xxcam_fh *fh; | 1454 | struct omap24xxcam_fh *fh; |
1456 | struct v4l2_format format; | 1455 | struct v4l2_format format; |
1457 | 1456 | ||
1458 | if (!cam || !cam->vfd || (cam->vfd->minor != minor)) | 1457 | if (!cam || !cam->vfd) |
1459 | return -ENODEV; | 1458 | return -ENODEV; |
1460 | 1459 | ||
1461 | fh = kzalloc(sizeof(*fh), GFP_KERNEL); | 1460 | fh = kzalloc(sizeof(*fh), GFP_KERNEL); |