aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-12-10 02:43:38 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:22 -0500
commit025341d4f0caa58f0e5eddbffd11d44e37cff974 (patch)
tree393d3b20eeef7c12172b4955d060efc8af4651ec /drivers
parent55712ff7e06b721fbeebd36499bad4a11b7d8327 (diff)
V4L/DVB (6755): Avoid troubles when using multiple devices
mv_count is a counter used to move the vertical bars. Before this patch, it where a static var. This works fine for just one device. However, when using multiple devices, every device would increment it. This patch moves it to its correct place: struct vivi_dev. So, now, each device has its own data. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/vivi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index fda01f49efd..ea9ff8a9bfd 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -178,6 +178,8 @@ struct vivi_dev {
178 /* Several counters */ 178 /* Several counters */
179 int h,m,s,us,jiffies; 179 int h,m,s,us,jiffies;
180 char timestr[13]; 180 char timestr[13];
181
182 int mv_count; /* Controls bars movement */
181}; 183};
182 184
183struct vivi_fh { 185struct vivi_fh {
@@ -327,14 +329,12 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
327 struct timeval ts; 329 struct timeval ts;
328 char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL); 330 char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL);
329 void *vbuf=videobuf_to_vmalloc (&buf->vb); 331 void *vbuf=videobuf_to_vmalloc (&buf->vb);
330 /* FIXME: move to dev struct */
331 static int mv_count=0;
332 332
333 if (!tmpbuf) 333 if (!tmpbuf)
334 return; 334 return;
335 335
336 for (h=0;h<hmax;h++) { 336 for (h=0;h<hmax;h++) {
337 gen_line(tmpbuf,0,wmax,hmax,h,mv_count, 337 gen_line(tmpbuf, 0, wmax, hmax, h, dev->mv_count,
338 dev->timestr); 338 dev->timestr);
339 /* FIXME: replacing to __copy_to_user */ 339 /* FIXME: replacing to __copy_to_user */
340 if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0) 340 if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0)
@@ -342,7 +342,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
342 pos += wmax*2; 342 pos += wmax*2;
343 } 343 }
344 344
345 mv_count++; 345 dev->mv_count++;
346 346
347 kfree(tmpbuf); 347 kfree(tmpbuf);
348 348