Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4bfe66048e97d29ab229519e9a821dbd4d929bd9
Commit:     4bfe66048e97d29ab229519e9a821dbd4d929bd9
Parent:     8de577095d65e8a51135793bf48c7be6c6c5bc77
Author:     Matthias Kaehlcke <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 24 14:59:09 2007 +0200
Committer:  Mark M. Hoffman <[EMAIL PROTECTED]>
CommitDate: Thu Nov 8 08:42:46 2007 -0500

    hwmon: (lm70) Convert semaphore to mutex
    
    Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
    Acked-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 drivers/hwmon/lm70.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index dd36688..d435f00 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -31,14 +31,15 @@
 #include <linux/err.h>
 #include <linux/sysfs.h>
 #include <linux/hwmon.h>
+#include <linux/mutex.h>
 #include <linux/spi/spi.h>
-#include <asm/semaphore.h>
+
 
 #define DRVNAME                "lm70"
 
 struct lm70 {
        struct device *hwmon_dev;
-       struct semaphore sem;
+       struct mutex lock;
 };
 
 /* sysfs hook function */
@@ -51,7 +52,7 @@ static ssize_t lm70_sense_temp(struct device *dev,
        s16 raw=0;
        struct lm70 *p_lm70 = dev_get_drvdata(&spi->dev);
 
-       if (down_interruptible(&p_lm70->sem))
+       if (mutex_lock_interruptible(&p_lm70->lock))
                return -ERESTARTSYS;
 
        /*
@@ -83,7 +84,7 @@ static ssize_t lm70_sense_temp(struct device *dev,
        val = ((int)raw/32) * 250;
        status = sprintf(buf, "%d\n", val); /* millidegrees Celsius */
 out:
-       up(&p_lm70->sem);
+       mutex_unlock(&p_lm70->lock);
        return status;
 }
 
@@ -112,7 +113,7 @@ static int __devinit lm70_probe(struct spi_device *spi)
        if (!p_lm70)
                return -ENOMEM;
 
-       init_MUTEX(&p_lm70->sem);
+       mutex_init(&p_lm70->lock);
 
        /* sysfs hook */
        p_lm70->hwmon_dev = hwmon_device_register(&spi->dev);
-
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