2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-29 13:28:01 +00:00

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
This commit is contained in:
Jean Delvare 2009-01-12 10:31:58 +00:00
parent a16b7a42aa
commit bcddaa74a1

View File

@ -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"