projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for...
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
drivers
/
hwmon
/
adm1021.c
diff --git
a/drivers/hwmon/adm1021.c
b/drivers/hwmon/adm1021.c
index
8102876
..
2b6e74d
100644
(file)
--- a/
drivers/hwmon/adm1021.c
+++ b/
drivers/hwmon/adm1021.c
@@
-26,6
+26,7
@@
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/err.h>
+#include <linux/mutex.h>
/* Addresses to scan */
/* Addresses to scan */
@@
-92,7
+93,7
@@
struct adm1021_data {
struct class_device *class_dev;
enum chips type;
struct class_device *class_dev;
enum chips type;
- struct
semaphore
update_lock;
+ struct
mutex
update_lock;
char valid; /* !=0 if following fields are valid */
unsigned long last_updated; /* In jiffies */
char valid; /* !=0 if following fields are valid */
unsigned long last_updated; /* In jiffies */
@@
-126,10
+127,10
@@
static int read_only;
/* This is the driver that will be inserted */
static struct i2c_driver adm1021_driver = {
/* This is the driver that will be inserted */
static struct i2c_driver adm1021_driver = {
- .owner = THIS_MODULE,
- .name = "adm1021",
+ .driver = {
+ .name = "adm1021",
+ },
.id = I2C_DRIVERID_ADM1021,
.id = I2C_DRIVERID_ADM1021,
- .flags = I2C_DF_NOTIFY,
.attach_adapter = adm1021_attach_adapter,
.detach_client = adm1021_detach_client,
};
.attach_adapter = adm1021_attach_adapter,
.detach_client = adm1021_detach_client,
};
@@
-162,10
+163,10
@@
static ssize_t set_##value(struct device *dev, struct device_attribute *attr, co
struct adm1021_data *data = i2c_get_clientdata(client); \
int temp = simple_strtoul(buf, NULL, 10); \
\
struct adm1021_data *data = i2c_get_clientdata(client); \
int temp = simple_strtoul(buf, NULL, 10); \
\
-
down(&data->update_lock);
\
+
mutex_lock(&data->update_lock);
\
data->value = TEMP_TO_REG(temp); \
adm1021_write_value(client, reg, data->value); \
data->value = TEMP_TO_REG(temp); \
adm1021_write_value(client, reg, data->value); \
-
up(&data->update_lock);
\
+
mutex_unlock(&data->update_lock);
\
return count; \
}
set(temp_max, ADM1021_REG_TOS_W);
return count; \
}
set(temp_max, ADM1021_REG_TOS_W);
@@
-275,7
+276,7
@@
static int adm1021_detect(struct i2c_adapter *adapter, int address, int kind)
strlcpy(new_client->name, type_name, I2C_NAME_SIZE);
data->type = kind;
data->valid = 0;
strlcpy(new_client->name, type_name, I2C_NAME_SIZE);
data->type = kind;
data->valid = 0;
-
init_MUTEX
(&data->update_lock);
+
mutex_init
(&data->update_lock);
/* Tell the I2C layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
/* Tell the I2C layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
@@
-351,7
+352,7
@@
static struct adm1021_data *adm1021_update_device(struct device *dev)
struct i2c_client *client = to_i2c_client(dev);
struct adm1021_data *data = i2c_get_clientdata(client);
struct i2c_client *client = to_i2c_client(dev);
struct adm1021_data *data = i2c_get_clientdata(client);
-
down
(&data->update_lock);
+
mutex_lock
(&data->update_lock);
if (time_after(jiffies, data->last_updated + HZ + HZ / 2)
|| !data->valid) {
if (time_after(jiffies, data->last_updated + HZ + HZ / 2)
|| !data->valid) {
@@
-375,7
+376,7
@@
static struct adm1021_data *adm1021_update_device(struct device *dev)
data->valid = 1;
}
data->valid = 1;
}
-
up
(&data->update_lock);
+
mutex_unlock
(&data->update_lock);
return data;
}
return data;
}