mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-28 20:58:22 +00:00
library: Handle the i2c-isa case properly even after the class_dev
removal. In recent kernels we can detect i2c-isa devices by checking the i2c bus number: i2c-isa always uses 9191 as its bus number. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4337 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
bb954ebf0e
commit
560d6cc458
2 files changed
+14
-7
No files matched your search
+12
-7
@@ -75,18 +75,23 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
|
||||
|
||||
if (sscanf(dev->name, "%d-%x", &entry.name.bus, &entry.name.addr) == 2) {
|
||||
/* find out if legacy ISA or not */
|
||||
snprintf(bus_path, sizeof(bus_path),
|
||||
if (entry.name.bus == 9191)
|
||||
entry.name.bus = SENSORS_CHIP_NAME_BUS_ISA;
|
||||
else {
|
||||
snprintf(bus_path, sizeof(bus_path),
|
||||
"%s/class/i2c-adapter/i2c-%d/device/name",
|
||||
sensors_sysfs_mount, entry.name.bus);
|
||||
|
||||
if ((bus_attr = sysfs_open_attribute(bus_path))) {
|
||||
if (sysfs_read_attribute(bus_attr))
|
||||
return -SENSORS_ERR_PARSE;
|
||||
if ((bus_attr = sysfs_open_attribute(bus_path))) {
|
||||
if (sysfs_read_attribute(bus_attr))
|
||||
return -SENSORS_ERR_PARSE;
|
||||
|
||||
if (bus_attr->value && !strncmp(bus_attr->value, "ISA ", 4))
|
||||
entry.name.bus = SENSORS_CHIP_NAME_BUS_ISA;
|
||||
if (bus_attr->value
|
||||
&& !strncmp(bus_attr->value, "ISA ", 4))
|
||||
entry.name.bus = SENSORS_CHIP_NAME_BUS_ISA;
|
||||
|
||||
sysfs_close_attribute(bus_attr);
|
||||
sysfs_close_attribute(bus_attr);
|
||||
}
|
||||
}
|
||||
} else if (sscanf(dev->name, "%*[a-z0-9_].%d", &entry.name.addr) == 1) {
|
||||
/* must be new ISA (platform driver) */
|
||||
|
||||
Reference in new issue
Block a user