lm_sensors/lm_sensors-3.0.1-virtual-dev.patch
Hans de Goede 3a7e0ed487 - Make libsensors work with hwmon class entries without a device link such
as the acpi thermal_zone driver (bz 437637)
2008-03-16 10:14:31 +00:00

22 lines
620 B
Diff

Index: lib/sysfs.c
===================================================================
--- lib/sysfs.c (revision 5142)
+++ lib/sysfs.c (working copy)
@@ -591,8 +591,14 @@
snprintf(linkpath, NAME_MAX, "%s/device", path);
dev_len = readlink(linkpath, device, NAME_MAX - 1);
- if (dev_len < 0)
- return -SENSORS_ERR_KERNEL;
+ if (dev_len < 0) {
+ /* virtual device without a device link (for example
+ the acpi thermalzone driver) */
+ err = sensors_read_one_sysfs_chip(path, "virtual", path);
+ if (err < 0)
+ return err;
+ return 0;
+ }
device[dev_len] = '\0';
device_p = strrchr(device, '/') + 1;