diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-10-28 14:31:44 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2010-10-28 14:31:44 -0400 |
commit | 9c627e3be3e8f36eda73ed9e8aa4763582841c1f (patch) | |
tree | e04a1c7d96ea649e2f7831d388fa6b643411f0a3 /drivers | |
parent | caaa0f36c378c6fec6fd5260a63566e002ac4a84 (diff) |
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')
-rw-r--r-- | drivers/hwmon/s3c-hwmon.c | 8 |
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 { | |||
51 | * @attr: The holders for the channel attributes. | 51 | * @attr: The holders for the channel attributes. |
52 | */ | 52 | */ |
53 | struct s3c_hwmon { | 53 | struct s3c_hwmon { |
54 | struct semaphore lock; | 54 | struct mutex lock; |
55 | struct s3c_adc_client *client; | 55 | struct s3c_adc_client *client; |
56 | struct device *hwmon_dev; | 56 | struct device *hwmon_dev; |
57 | 57 | ||
@@ -73,14 +73,14 @@ static int s3c_hwmon_read_ch(struct device *dev, | |||
73 | { | 73 | { |
74 | int ret; | 74 | int ret; |
75 | 75 | ||
76 | ret = down_interruptible(&hwmon->lock); | 76 | ret = mutex_lock_interruptible(&hwmon->lock); |
77 | if (ret < 0) | 77 | if (ret < 0) |
78 | return ret; | 78 | return ret; |
79 | 79 | ||
80 | dev_dbg(dev, "reading channel %d\n", channel); | 80 | dev_dbg(dev, "reading channel %d\n", channel); |
81 | 81 | ||
82 | ret = s3c_adc_read(hwmon->client, channel); | 82 | ret = s3c_adc_read(hwmon->client, channel); |
83 | up(&hwmon->lock); | 83 | mutex_unlock(&hwmon->lock); |
84 | 84 | ||
85 | return ret; | 85 | return ret; |
86 | } | 86 | } |
@@ -296,7 +296,7 @@ static int __devinit s3c_hwmon_probe(struct platform_device *dev) | |||
296 | 296 | ||
297 | platform_set_drvdata(dev, hwmon); | 297 | platform_set_drvdata(dev, hwmon); |
298 | 298 | ||
299 | init_MUTEX(&hwmon->lock); | 299 | mutex_init(&hwmon->lock); |
300 | 300 | ||
301 | /* Register with the core ADC driver. */ | 301 | /* Register with the core ADC driver. */ |
302 | 302 | ||