diff options
Diffstat (limited to 'drivers/hwmon/s3c-hwmon.c')
-rw-r--r-- | drivers/hwmon/s3c-hwmon.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c index 3f3f9a47acfd..b39f52e2752a 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 | } |
@@ -232,9 +232,9 @@ static int s3c_hwmon_create_attr(struct device *dev, | |||
232 | 232 | ||
233 | attr = &attrs->in; | 233 | attr = &attrs->in; |
234 | attr->index = channel; | 234 | attr->index = channel; |
235 | sysfs_attr_init(&attr->dev_attr.attr); | ||
235 | attr->dev_attr.attr.name = attrs->in_name; | 236 | attr->dev_attr.attr.name = attrs->in_name; |
236 | attr->dev_attr.attr.mode = S_IRUGO; | 237 | attr->dev_attr.attr.mode = S_IRUGO; |
237 | attr->dev_attr.attr.owner = THIS_MODULE; | ||
238 | attr->dev_attr.show = s3c_hwmon_ch_show; | 238 | attr->dev_attr.show = s3c_hwmon_ch_show; |
239 | 239 | ||
240 | ret = device_create_file(dev, &attr->dev_attr); | 240 | ret = device_create_file(dev, &attr->dev_attr); |
@@ -250,9 +250,9 @@ static int s3c_hwmon_create_attr(struct device *dev, | |||
250 | 250 | ||
251 | attr = &attrs->label; | 251 | attr = &attrs->label; |
252 | attr->index = channel; | 252 | attr->index = channel; |
253 | sysfs_attr_init(&attr->dev_attr.attr); | ||
253 | attr->dev_attr.attr.name = attrs->label_name; | 254 | attr->dev_attr.attr.name = attrs->label_name; |
254 | attr->dev_attr.attr.mode = S_IRUGO; | 255 | attr->dev_attr.attr.mode = S_IRUGO; |
255 | attr->dev_attr.attr.owner = THIS_MODULE; | ||
256 | attr->dev_attr.show = s3c_hwmon_label_show; | 256 | attr->dev_attr.show = s3c_hwmon_label_show; |
257 | 257 | ||
258 | ret = device_create_file(dev, &attr->dev_attr); | 258 | ret = device_create_file(dev, &attr->dev_attr); |
@@ -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 | ||