libsensors: Get the i2c adapter names from the class device's "name"

attribute, falling back to the device's "name" attribute for
compatibility only. This change is needed to match ongoing cleanups in
Linux 2.6's i2c-core. i2c adapters will soon be class devices only, the
legacy i2c_adapter devices and driver are being removed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4267 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2006-12-21 08:24:01 +00:00
1 parent 0a36a5daa3
commit 6af70f2828
2 files changed
+6 -1

No files matched your search

+1
View File
@@ -12,6 +12,7 @@ SVN HEAD
Add config-file scanner regression tests
Add f71872f support
Add w83627dhg support (David Holl, #2157)
Get the i2c adapter names from classdev.name
Man page i2cdetect.8: Describe the output convention
Man page sensors.1: Update (option -c) and clean up
Module i2c-i801: Add ICH9 support
+5 -1
View File
@@ -197,7 +197,11 @@ int sensors_read_sysfs_bus(void)
if (!(dev = sysfs_get_classdev_device(clsdev)))
continue;
if (!(attr = sysfs_get_device_attr(dev, "name")))
/* 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")))
continue;
/* NB: attr->value[attr->len-1] == '\n'; chop that off */