diff --git a/CHANGES b/CHANGES index 650ec83b..12c32a57 100644 --- a/CHANGES +++ b/CHANGES @@ -9,9 +9,10 @@ SVN HEAD Add long switches to manual page sensors-detect: Don't choke on systems without PCI Avoid probing EDID addresses on graphics cards (#2386) - Add detection of NCT6779D and NCT6102D/NCT6106D - Add detection of SMSC LPC47N217 and SIO10N268 + Add detection of NCT6779D and NCT6102D/NCT6106D + Add detection of SMSC LPC47N217 and SIO10N268 Do not scan I2C adapters on graphics cards by default + Fix parent class discovery when multiplexer is present 3.3.2 (2012-03-14) libsensors: Added support for new sysfs attributes diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 4090fadc..475c76c1 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2,7 +2,7 @@ # # sensors-detect - Detect hardware monitoring chips # Copyright (C) 1998 - 2002 Frodo Looijaard -# Copyright (C) 2004 - 2011 Jean Delvare +# Copyright (C) 2004 - 2012 Jean Delvare # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2696,14 +2696,15 @@ sub initialize_i2c_adapters_list } elsif ($link =~ m/^(.*)\/i2c-$nr$/) { $entry->{path} = "${base_dir}/i2c-$nr/device"; $entry->{parent} = "${base_dir}/i2c-$nr/$1"; - } else { - $entry->{path} = "${base_dir}/i2c-$nr"; - $entry->{parent} = "$entry->{path}/device"; } - } else { + } + + # This works for all recent kernels (with or without + # CONFIG_I2C_COMPAT) + if (!defined $entry->{path}) { my $link = readlink("${base_dir}/i2c-$nr"); - $link =~ s/\/i2c-$nr$//; $entry->{path} = "${base_dir}/i2c-$nr"; + $link =~ s/(\/i2c-[0-9]+)+$//; # Handle multiplexers too $entry->{parent} = "${base_dir}/$link"; }