Merge from trunk (4303:4355) out to 3.0.0 branch.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4357 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark M. Hoffman committed 2007-04-03 12:55:30 +00:00
1 parent 2bb6b1859a
commit c5ffa7b635
50 files changed
+1024 -888

No files matched your search

+14 -10
View File
@@ -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) */
@@ -195,13 +200,12 @@ int sensors_read_sysfs_bus(void)
struct sysfs_device *dev;
struct sysfs_attribute *attr;
if (!(dev = sysfs_get_classdev_device(clsdev)))
continue;
/* Get the adapter name from the classdev "name" attribute
* (Linux 2.6.20 and later). If it fails, fall back to
* the device "name" attribute (for older kernels). */
if (!(attr = sysfs_get_classdev_attr(clsdev, "name"))
&& !(attr = sysfs_get_device_attr(dev, "name")))
&& !((dev = sysfs_get_classdev_device(clsdev)) &&
(attr = sysfs_get_device_attr(dev, "name"))))
continue;
/* NB: attr->value[attr->len-1] == '\n'; chop that off */