mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-06 15:51:34 +00:00
Fix bus matching mechanism which had always been broken for Linux
2.6. Original patch from Karsten Petersen. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3076 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
28f8be1038
commit
27e2a62bab
1 file changed
+10
-7
+10
-7
@@ -226,17 +226,20 @@ int sensors_substitute_chip(sensors_chip_name *name,int lineno)
|
||||
return -SENSORS_ERR_BUS_NAME;
|
||||
}
|
||||
|
||||
/* We used to compare both the adapter and the algorithm names for
|
||||
bus matching, but Linux 2.6 has no more names for algorithms, and
|
||||
it was redundant anyway. So we now only rely on the adapter name. */
|
||||
for (j = 0; j < sensors_proc_bus_count; j++) {
|
||||
if (!strcmp(sensors_config_busses[i].adapter,
|
||||
sensors_proc_bus[j].adapter) &&
|
||||
!strcmp(sensors_config_busses[i].algorithm,
|
||||
sensors_proc_bus[j].algorithm))
|
||||
break;
|
||||
sensors_proc_bus[j].adapter)) {
|
||||
name->bus = sensors_proc_bus[j].number;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Well, if we did not find anything, j = sensors_proc_bus_count; so if
|
||||
we set this chip's bus number to j, it will never be matched. Good. */
|
||||
name->bus = j;
|
||||
/* We did not find anything. sensors_proc_bus_count is not a valid
|
||||
bus number, so it will never be matched. Good. */
|
||||
name->bus = sensors_proc_bus_count;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user