summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/vivi.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-12-10 05:43:38 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-12-10 05:43:38 -0200
commitb6b28e59f3a63abba79eda2ef1de8b4e76e8cdc8 (patch)
treebb0c13cc7e4ef7a7a6d5e98dde22c51b2fd53531 /linux/drivers/media/video/vivi.c
parent1022b8e7b9eec01adec0cf40ed43487611f9022e (diff)
downloadmediapointer-dvb-s2-b6b28e59f3a63abba79eda2ef1de8b4e76e8cdc8.tar.gz
mediapointer-dvb-s2-b6b28e59f3a63abba79eda2ef1de8b4e76e8cdc8.tar.bz2
Avoid troubles when using multiple devices
From: Mauro Carvalho Chehab <mchehab@infradead.org> 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 'linux/drivers/media/video/vivi.c')
-rw-r--r--linux/drivers/media/video/vivi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index 64fc5ee8b..abe5228a0 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -195,6 +195,8 @@ struct vivi_dev {
/* Several counters */
int h,m,s,us,jiffies;
char timestr[13];
+
+ int mv_count; /* Controls bars movement */
};
struct vivi_fh {
@@ -356,14 +358,12 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
struct timeval ts;
char *tmpbuf = kmalloc(wmax*2,GFP_KERNEL);
void *vbuf=videobuf_to_vmalloc (&buf->vb);
- /* FIXME: move to dev struct */
- static int mv_count=0;
if (!tmpbuf)
return;
for (h=0;h<hmax;h++) {
- gen_line(tmpbuf,0,wmax,hmax,h,mv_count,
+ gen_line(tmpbuf, 0, wmax, hmax, h, dev->mv_count,
dev->timestr);
/* FIXME: replacing to __copy_to_user */
if (copy_to_user(vbuf+pos,tmpbuf,wmax*2)!=0)
@@ -371,7 +371,7 @@ static void vivi_fillbuff(struct vivi_dev *dev,struct vivi_buffer *buf)
pos += wmax*2;
}
- mv_count++;
+ dev->mv_count++;
kfree(tmpbuf);