diff --git a/kernel/i2c-dev.c b/kernel/i2c-dev.c index 79009d5e..e0db4a4a 100644 --- a/kernel/i2c-dev.c +++ b/kernel/i2c-dev.c @@ -26,8 +26,8 @@ #include #include #include -#include "compat.h" #include "i2c.h" +#include "compat.h" #include "smbus.h" #include "i2c-isa.h" #include "sensors.h" diff --git a/kernel/sensors.c b/kernel/sensors.c index c52e9e9c..3f30a531 100644 --- a/kernel/sensors.c +++ b/kernel/sensors.c @@ -25,10 +25,10 @@ #include #include "version.h" -#include "compat.h" #include "i2c.h" #include "i2c-isa.h" #include "sensors.h" +#include "compat.h" #ifdef MODULE diff --git a/prog/detect/detect.pl b/prog/detect/detect.pl index 97de00b3..7f0027b8 100755 --- a/prog/detect/detect.pl +++ b/prog/detect/detect.pl @@ -1389,7 +1389,7 @@ sub generate_modprobes { my ($prefer_isa) = @_; - my ($chip,$detection,%adapters,$nr,@optionlist); + my ($chip,$detection,%adapters,$nr,$i,@optionlist); my $modprobes = ""; my $configfile = ""; @@ -1414,8 +1414,11 @@ sub generate_modprobes not (exists $detection->{i2c_driver} and not $prefer_isa); } } - foreach $detection (keys %adapters) { - $modprobes .= "modprobe $detection\n"; + for ($i = 0; $i < $nr; $i ++) { + foreach $detection (keys %adapters) { + $modprobes .= "modprobe $detection\n", last + if $adapters{$detection} == $i; + } } # Now determine the chip probe lines diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 97de00b3..7f0027b8 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -1389,7 +1389,7 @@ sub generate_modprobes { my ($prefer_isa) = @_; - my ($chip,$detection,%adapters,$nr,@optionlist); + my ($chip,$detection,%adapters,$nr,$i,@optionlist); my $modprobes = ""; my $configfile = ""; @@ -1414,8 +1414,11 @@ sub generate_modprobes not (exists $detection->{i2c_driver} and not $prefer_isa); } } - foreach $detection (keys %adapters) { - $modprobes .= "modprobe $detection\n"; + for ($i = 0; $i < $nr; $i ++) { + foreach $detection (keys %adapters) { + $modprobes .= "modprobe $detection\n", last + if $adapters{$detection} == $i; + } } # Now determine the chip probe lines