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/bt8xx | |
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/bt8xx')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 15 |
1 files changed, 4 insertions, 11 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 | ||