From a9a3659fe9bc3a6b03e9458b55fccabd1680f627 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Wed, 10 Mar 1999 20:31:58 +0000 Subject: [PATCH] Minor fixes * No more redefined complaints of MODULE_* symbols for 2.0 kernels This was introduced by the last archive of Simon * Correct load order of adapters in detect script modprobe report You can't assume things come out of a hash in the same order as you put them in, of course :-( git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@303 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/i2c-dev.c | 2 +- kernel/sensors.c | 2 +- prog/detect/detect.pl | 9 ++++++--- prog/detect/sensors-detect | 9 ++++++--- 4 files changed, 14 insertions(+), 8 deletions(-) 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