summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c14
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.h2
2 files changed, 7 insertions, 9 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index c0af67c34..22391bd9f 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -3365,8 +3365,7 @@ void dvb_video_add_event (av7110_t *av7110, struct video_event *event)
DEB_D(("\n"));
- if (down_interruptible (&events->sem))
- return;
+ spin_lock_bh(&events->lock);
wp = (events->eventw + 1) % MAX_VIDEO_EVENT;
@@ -3380,7 +3379,7 @@ void dvb_video_add_event (av7110_t *av7110, struct video_event *event)
events->eventw = wp;
- up (&events->sem);
+ spin_unlock_bh(&events->lock);
wake_up_interruptible (&events->wait_queue);
}
@@ -3410,15 +3409,14 @@ int dvb_video_get_event (av7110_t *av7110, struct video_event *event, int flags)
return ret;
}
- if (down_interruptible (&events->sem))
- return -ERESTARTSYS;
+ spin_lock_bh(&events->lock);
memcpy (event, &events->events[events->eventr],
sizeof(struct video_event));
events->eventr = (events->eventr + 1) % MAX_VIDEO_EVENT;
- up (&events->sem);
+ spin_unlock_bh(&events->lock);
return 0;
}
@@ -4049,8 +4047,8 @@ int av7110_register(av7110_t *av7110)
if (ret < 0)
return ret;
- init_waitqueue_head (&av7110->video_events.wait_queue);
- init_MUTEX (&av7110->video_events.sem);
+ init_waitqueue_head(&av7110->video_events.wait_queue);
+ spin_lock_init(&av7110->video_events.lock);
av7110->video_events.eventw = av7110->video_events.eventr = 0;
av7110->video_events.overflow = 0;
memset(&av7110->video_size, 0, sizeof (video_size_t));
diff --git a/linux/drivers/media/dvb/ttpci/av7110.h b/linux/drivers/media/dvb/ttpci/av7110.h
index b9d2fc995..0128ba102 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.h
+++ b/linux/drivers/media/dvb/ttpci/av7110.h
@@ -456,7 +456,7 @@ struct dvb_video_events {
int eventr;
int overflow;
wait_queue_head_t wait_queue;
- struct semaphore sem;
+ spinlock_t lock;
};