Add support for the new platform drivers (Linux 2.6, sysfs).

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3224 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2006-01-09 19:55:18 +00:00
1 parent dcf611d1c7
commit 337ffc5729
1 file changed
+7 -4
+7 -4
View File
@@ -71,10 +71,8 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
if (!entry.name.busname) if (!entry.name.busname)
sensors_fatal_error(__FUNCTION__, "out of memory"); sensors_fatal_error(__FUNCTION__, "out of memory");
if (sscanf(dev->name, "%d-%x", &entry.name.bus, &entry.name.addr) != 2) if (sscanf(dev->name, "%d-%x", &entry.name.bus, &entry.name.addr) == 2) {
return -SENSORS_ERR_PARSE; /* find out if legacy ISA or not */
/* find out if ISA or not */
snprintf(bus_path, sizeof(bus_path), snprintf(bus_path, sizeof(bus_path),
"%s/class/i2c-adapter/i2c-%d/device/name", "%s/class/i2c-adapter/i2c-%d/device/name",
sensors_sysfs_mount, entry.name.bus); sensors_sysfs_mount, entry.name.bus);
@@ -88,6 +86,11 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
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) */
entry.name.bus = SENSORS_CHIP_NAME_BUS_ISA;
} else
return -SENSORS_ERR_PARSE;
sensors_add_proc_chips(&entry); sensors_add_proc_chips(&entry);