Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d9c01ceff00fcba50043f500cac471ecf6752c9
Commit:     9d9c01ceff00fcba50043f500cac471ecf6752c9
Parent:     d75d53cd571c02990d56e72f615ab11e943772f9
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 12 14:12:28 2007 +0200
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 14:12:28 2007 +0200

    scx200_acb: Use mutex instead of semaphore
    
    The scx200_acb driver use a semaphore as mutex.  Use the mutex API
    instead of the (binary) semaphore.
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Cc: Jordan Crouse <[EMAIL PROTECTED]>
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/scx200_acb.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 0d6bd4f..dc64f8b 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -388,7 +388,7 @@ static const struct i2c_algorithm scx200_acb_algorithm = {
 };
 
 static struct scx200_acb_iface *scx200_acb_list;
-static DECLARE_MUTEX(scx200_acb_list_mutex);
+static DEFINE_MUTEX(scx200_acb_list_mutex);
 
 static __init int scx200_acb_probe(struct scx200_acb_iface *iface)
 {
@@ -472,10 +472,10 @@ static int __init scx200_acb_create(struct 
scx200_acb_iface *iface)
                return -ENODEV;
        }
 
-       down(&scx200_acb_list_mutex);
+       mutex_lock(&scx200_acb_list_mutex);
        iface->next = scx200_acb_list;
        scx200_acb_list = iface;
-       up(&scx200_acb_list_mutex);
+       mutex_unlock(&scx200_acb_list_mutex);
 
        return 0;
 }
@@ -633,10 +633,10 @@ static void __exit scx200_acb_cleanup(void)
 {
        struct scx200_acb_iface *iface;
 
-       down(&scx200_acb_list_mutex);
+       mutex_lock(&scx200_acb_list_mutex);
        while ((iface = scx200_acb_list) != NULL) {
                scx200_acb_list = iface->next;
-               up(&scx200_acb_list_mutex);
+               mutex_unlock(&scx200_acb_list_mutex);
 
                i2c_del_adapter(&iface->adapter);
 
@@ -648,9 +648,9 @@ static void __exit scx200_acb_cleanup(void)
                        release_region(iface->base, 8);
 
                kfree(iface);
-               down(&scx200_acb_list_mutex);
+               mutex_lock(&scx200_acb_list_mutex);
        }
-       up(&scx200_acb_list_mutex);
+       mutex_unlock(&scx200_acb_list_mutex);
 }
 
 module_init(scx200_acb_init);
-
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