lm_sensors/lm_sensors-3.0.1-pci-without-subsys.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

32 lines
1.1 KiB
Diff

Index: lib/sysfs.c
===================================================================
--- lib/sysfs.c (revision 5142)
+++ lib/sysfs.c (working copy)
@@ -524,19 +524,19 @@
/* SPI */
entry.chip.bus.type = SENSORS_BUS_TYPE_SPI;
} else
+ if ((!subsys || !strcmp(subsys, "pci")) &&
+ sscanf(dev_name, "%x:%x:%x.%x", &domain, &bus, &slot, &fn) == 4) {
+ /* PCI */
+ entry.chip.addr = (domain << 16) + (bus << 8) + (slot << 3) + fn;
+ entry.chip.bus.type = SENSORS_BUS_TYPE_PCI;
+ entry.chip.bus.nr = 0;
+ } else
if ((!subsys || !strcmp(subsys, "platform"))) {
/* must be new ISA (platform driver) */
if (sscanf(dev_name, "%*[a-z0-9_].%d", &entry.chip.addr) != 1)
entry.chip.addr = 0;
entry.chip.bus.type = SENSORS_BUS_TYPE_ISA;
entry.chip.bus.nr = 0;
- } else
- if ((!subsys || !strcmp(subsys, "pci")) &&
- sscanf(dev_name, "%x:%x:%x.%x", &domain, &bus, &slot, &fn) == 4) {
- /* PCI */
- entry.chip.addr = (domain << 16) + (bus << 8) + (slot << 3) + fn;
- entry.chip.bus.type = SENSORS_BUS_TYPE_PCI;
- entry.chip.bus.nr = 0;
} else {
/* Ignore unknown device */
err = 0;