Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03b7612336560c6799852acaaaeac70e1f00e483
Commit:     03b7612336560c6799852acaaaeac70e1f00e483
Parent:     667c7bc0aff18288186f1223784b57f77be7d81b
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 30 14:58:10 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 22:03:34 2007 -0300

    V4L/DVB (5946): Use mutex instead of semaphore in the DVB frontend tuning 
interface
    
    The DVB frontend tuning interface uses a semaphore as mutex. Use the
    mutex API instead of the (binary) semaphore.
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Signed-off-by: Michael Krufky <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |   10 +++++-----
 drivers/media/dvb/dvb-core/dvb_frontend.h |    3 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c 
b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 384b5b8..afe797b 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -138,7 +138,7 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, 
fe_status_t status)
 
        dprintk ("%s\n", __FUNCTION__);
 
-       if (down_interruptible (&events->sem))
+       if (mutex_lock_interruptible (&events->mtx))
                return;
 
        wp = (events->eventw + 1) % MAX_EVENT;
@@ -159,7 +159,7 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, 
fe_status_t status)
 
        events->eventw = wp;
 
-       up (&events->sem);
+       mutex_unlock(&events->mtx);
 
        e->status = status;
 
@@ -197,7 +197,7 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe,
                        return ret;
        }
 
-       if (down_interruptible (&events->sem))
+       if (mutex_lock_interruptible (&events->mtx))
                return -ERESTARTSYS;
 
        memcpy (event, &events->events[events->eventr],
@@ -205,7 +205,7 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe,
 
        events->eventr = (events->eventr + 1) % MAX_EVENT;
 
-       up (&events->sem);
+       mutex_unlock(&events->mtx);
 
        return 0;
 }
@@ -1126,7 +1126,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
        init_MUTEX (&fepriv->sem);
        init_waitqueue_head (&fepriv->wait_queue);
        init_waitqueue_head (&fepriv->events.wait_queue);
-       init_MUTEX (&fepriv->events.sem);
+       mutex_init(&fepriv->events.mtx);
        fe->dvb = dvb;
        fepriv->inversion = INVERSION_OFF;
 
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h 
b/drivers/media/dvb/dvb-core/dvb_frontend.h
index a770a87..f95de63 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.h
@@ -35,6 +35,7 @@
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
+#include <linux/mutex.h>
 
 #include <linux/dvb/frontend.h>
 
@@ -142,7 +143,7 @@ struct dvb_fe_events {
        int                       eventr;
        int                       overflow;
        wait_queue_head_t         wait_queue;
-       struct semaphore          sem;
+       struct mutex              mtx;
 };
 
 struct dvb_frontend {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to