aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-empress.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-empress.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index a16df57af63..34ca874dd7f 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -76,17 +76,14 @@ static int ts_init_encoder(struct saa7134_dev* dev)
76static int ts_open(struct inode *inode, struct file *file) 76static int ts_open(struct inode *inode, struct file *file)
77{ 77{
78 int minor = iminor(inode); 78 int minor = iminor(inode);
79 struct saa7134_dev *h,*dev = NULL; 79 struct saa7134_dev *dev;
80 struct list_head *list;
81 int err; 80 int err;
82 81
83 list_for_each(list,&saa7134_devlist) { 82 list_for_each_entry(dev, &saa7134_devlist, devlist)
84 h = list_entry(list, struct saa7134_dev, devlist); 83 if (dev->empress_dev && dev->empress_dev->minor == minor)
85 if (h->empress_dev && h->empress_dev->minor == minor) 84 goto found;
86 dev = h; 85 return -ENODEV;
87 } 86 found:
88 if (NULL == dev)
89 return -ENODEV;
90 87
91 dprintk("open minor=%d\n",minor); 88 dprintk("open minor=%d\n",minor);
92 err = -EBUSY; 89 err = -EBUSY;