提交 9c627e3b 编写于 作者: T Thomas Gleixner 提交者: Jean Delvare

hwmon: (s3c-hwmon) Use a real mutex

The semaphore which protects the ADC is semantically a mutex. Use a
real mutex.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 caaa0f36
...@@ -51,7 +51,7 @@ struct s3c_hwmon_attr { ...@@ -51,7 +51,7 @@ struct s3c_hwmon_attr {
* @attr: The holders for the channel attributes. * @attr: The holders for the channel attributes.
*/ */
struct s3c_hwmon { struct s3c_hwmon {
struct semaphore lock; struct mutex lock;
struct s3c_adc_client *client; struct s3c_adc_client *client;
struct device *hwmon_dev; struct device *hwmon_dev;
...@@ -73,14 +73,14 @@ static int s3c_hwmon_read_ch(struct device *dev, ...@@ -73,14 +73,14 @@ static int s3c_hwmon_read_ch(struct device *dev,
{ {
int ret; int ret;
ret = down_interruptible(&hwmon->lock); ret = mutex_lock_interruptible(&hwmon->lock);
if (ret < 0) if (ret < 0)
return ret; return ret;
dev_dbg(dev, "reading channel %d\n", channel); dev_dbg(dev, "reading channel %d\n", channel);
ret = s3c_adc_read(hwmon->client, channel); ret = s3c_adc_read(hwmon->client, channel);
up(&hwmon->lock); mutex_unlock(&hwmon->lock);
return ret; return ret;
} }
...@@ -296,7 +296,7 @@ static int __devinit s3c_hwmon_probe(struct platform_device *dev) ...@@ -296,7 +296,7 @@ static int __devinit s3c_hwmon_probe(struct platform_device *dev)
platform_set_drvdata(dev, hwmon); platform_set_drvdata(dev, hwmon);
init_MUTEX(&hwmon->lock); mutex_init(&hwmon->lock);
/* Register with the core ADC driver. */ /* Register with the core ADC driver. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册