summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/s3c-hwmon.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-10-28 20:31:44 +0200
committerJean Delvare <khali@endymion.delvare>2010-10-28 20:31:44 +0200
commit9c627e3be3e8f36eda73ed9e8aa4763582841c1f (patch)
treee04a1c7d96ea649e2f7831d388fa6b643411f0a3 /drivers/hwmon/s3c-hwmon.c
parentcaaa0f36c378c6fec6fd5260a63566e002ac4a84 (diff)
downloadlinux-9c627e3be3e8f36eda73ed9e8aa4763582841c1f.tar.bz2
hwmon: (s3c-hwmon) Use a real mutex
The semaphore which protects the ADC is semantically a mutex. Use a real mutex. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/s3c-hwmon.c')
-rw-r--r--drivers/hwmon/s3c-hwmon.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
index 3f3f9a47acfd..05248f2d7581 100644
--- a/drivers/hwmon/s3c-hwmon.c
+++ b/drivers/hwmon/s3c-hwmon.c
@@ -51,7 +51,7 @@ struct s3c_hwmon_attr {
* @attr: The holders for the channel attributes.
*/
struct s3c_hwmon {
- struct semaphore lock;
+ struct mutex lock;
struct s3c_adc_client *client;
struct device *hwmon_dev;
@@ -73,14 +73,14 @@ static int s3c_hwmon_read_ch(struct device *dev,
{
int ret;
- ret = down_interruptible(&hwmon->lock);
+ ret = mutex_lock_interruptible(&hwmon->lock);
if (ret < 0)
return ret;
dev_dbg(dev, "reading channel %d\n", channel);
ret = s3c_adc_read(hwmon->client, channel);
- up(&hwmon->lock);
+ mutex_unlock(&hwmon->lock);
return ret;
}
@@ -296,7 +296,7 @@ static int __devinit s3c_hwmon_probe(struct platform_device *dev)
platform_set_drvdata(dev, hwmon);
- init_MUTEX(&hwmon->lock);
+ mutex_init(&hwmon->lock);
/* Register with the core ADC driver. */