3a7e0ed487
as the acpi thermal_zone driver (bz 437637)
22 lines
620 B
Diff
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;
|
|
|