From bcddaa74a1a247c7ffd3f25c3132d7e99033a89c Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 12 Jan 2009 10:31:58 +0000 Subject: [PATCH] Fix listing of needed bus drivers. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5584 7894878c-1315-0410-8ee3-d5d059ff63e0 --- prog/detect/sensors-detect | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 45346c0a..d624a76a 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2105,6 +2105,20 @@ sub load_module $modules_list{$normalized} = 1; } +sub loaded_by_us +{ + my $sought = shift; + local $_; + + $sought =~ tr/-/_/; + foreach (@modules_we_loaded) { + my $module = $_; + $module =~ tr/-/_/; + return 1 if $module eq $sought; + } + return 0; +} + sub initialize_modules_supported { foreach my $chip (@chip_ids) { @@ -5088,7 +5102,7 @@ sub generate_modprobes # the adapter drivers so that the numbers will be the same. If not, then # we only load the adapter drivers which are useful. foreach $adap (@i2c_adapters) { - next unless contains($adap->{driver}, @modules_we_loaded); + next unless loaded_by_us($adap->{driver}); next if not defined $configfile and not $adap->{used}; $modprobes .= "# I2C adapter drivers\n" unless defined $modprobes; $modprobes .= "modprobe $adap->{driver}\n"