mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-07 16:01:34 +00:00
Lock on reads and writes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2505 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
4ef5ecd429
commit
6e64cc2517
1 file changed
+4
@@ -324,13 +324,17 @@ static int smsc47m1_read_value(struct i2c_client *client, u8 reg)
|
||||
{
|
||||
int res;
|
||||
|
||||
down(&(((struct smsc47m1_data *) (client->data))->lock));
|
||||
res = inb_p(client->addr + reg);
|
||||
up(&(((struct smsc47m1_data *) (client->data))->lock));
|
||||
return res;
|
||||
}
|
||||
|
||||
static int smsc47m1_write_value(struct i2c_client *client, u8 reg, u8 value)
|
||||
{
|
||||
down(&(((struct smsc47m1_data *) (client->data))->lock));
|
||||
outb_p(value, client->addr + reg);
|
||||
up(&(((struct smsc47m1_data *) (client->data))->lock));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user