mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-21 11:39:31 +00:00
(Phil) Fixed mutex initialization problem in w83781d_detect:
Originally:
[...]
if (is_isa) {
data = (struct w83781d_data *) (((struct isa_client *) new_client)+1);
new_client->addr = 0;
((struct isa_client *) new_client)->isa_addr = address;
data->lock = MUTEX;
} else {
data = (struct w83781d_data *) (((struct i2c_client *) new_client)+1);
new_client->addr = address;
}
[...]
changed to this:
[...]
if (is_isa) {
data = (struct w83781d_data *) (((struct isa_client *) new_client)+1);
new_client->addr = 0;
((struct isa_client *) new_client)->isa_addr = address;
} else {
data = (struct w83781d_data *) (((struct i2c_client *) new_client)+1);
new_client->addr = address;
}
data->lock = MUTEX;
[...]
So, now the MUTEX is properly initialized for I2C chips, too. If the
mutex was knowly ignored for I2C devices (because the piix4 locks its
self), then the mutex should be ignored everywhere else in the code, but
it is not.
This seems to have solved my reproducable 'hanging' problem. But, other
drivers should be checked, too, just in case.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@433 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
6e95f32c93
commit
67ee5f476a
1 file changed
+1
-1
@@ -690,11 +690,11 @@ int w83781d_detect(struct i2c_adapter *adapter, int address, int kind)
|
||||
data = (struct w83781d_data *) (((struct isa_client *) new_client) + 1);
|
||||
new_client->addr = 0;
|
||||
((struct isa_client *) new_client)->isa_addr = address;
|
||||
data->lock = MUTEX;
|
||||
} else {
|
||||
data = (struct w83781d_data *) (((struct i2c_client *) new_client) + 1);
|
||||
new_client->addr = address;
|
||||
}
|
||||
data->lock = MUTEX;
|
||||
new_client->data = data;
|
||||
new_client->adapter = adapter;
|
||||
new_client->driver = &w83781d_driver;
|
||||
|
||||
Reference in new issue
Block a user