mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-29 13:28:01 +00:00
Don't create module options for bus drivers we don't even need to load.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5443 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
parent
3cdf96e0f4
commit
3ee60a6fac
@ -5141,31 +5141,6 @@ sub generate_modprobes
|
||||
my ($isa, $ipmi);
|
||||
my ($modprobes, $configfile);
|
||||
|
||||
# Handle aliases
|
||||
# As of kernel 2.6.28, alias detection is handled by kernel drivers
|
||||
# directly, so module options are no longer needed.
|
||||
unless (kernel_version_at_least(2, 6, 28)) {
|
||||
foreach $chip (@chips_detected) {
|
||||
@optionlist = ();
|
||||
foreach $detection (@{$chip->{detected}}) {
|
||||
if (exists $detection->{i2c_driver} and
|
||||
exists $detection->{isa_addr}) {
|
||||
push @optionlist, $detection->{i2c_devnr},
|
||||
$detection->{i2c_addr};
|
||||
}
|
||||
}
|
||||
|
||||
next if not @optionlist;
|
||||
$configfile = "# hwmon module options\n" unless defined $configfile;
|
||||
$configfile .= "options $chip->{driver}";
|
||||
$configfile .= sprintf(" ignore=%d,0x%02x", shift @optionlist,
|
||||
shift @optionlist);
|
||||
$configfile .= sprintf(",%d,0x%02x", shift @optionlist,
|
||||
shift @optionlist) while @optionlist;
|
||||
$configfile .= "\n";
|
||||
}
|
||||
}
|
||||
|
||||
foreach $chip (@chips_detected) {
|
||||
foreach $detection (@{$chip->{detected}}) {
|
||||
# Tag adapters which host hardware monitoring chips we want to access
|
||||
@ -5183,6 +5158,32 @@ sub generate_modprobes
|
||||
}
|
||||
}
|
||||
|
||||
# Handle aliases
|
||||
# As of kernel 2.6.28, alias detection is handled by kernel drivers
|
||||
# directly, so module options are no longer needed.
|
||||
unless (kernel_version_at_least(2, 6, 28)) {
|
||||
foreach $chip (@chips_detected) {
|
||||
@optionlist = ();
|
||||
foreach $detection (@{$chip->{detected}}) {
|
||||
if (exists $detection->{i2c_driver} and
|
||||
exists $detection->{isa_addr} and
|
||||
$i2c_adapters[$detection->{i2c_devnr}]->{used}) {
|
||||
push @optionlist, $detection->{i2c_devnr},
|
||||
$detection->{i2c_addr};
|
||||
}
|
||||
}
|
||||
|
||||
next if not @optionlist;
|
||||
$configfile = "# hwmon module options\n" unless defined $configfile;
|
||||
$configfile .= "options $chip->{driver}";
|
||||
$configfile .= sprintf(" ignore=%d,0x%02x", shift @optionlist,
|
||||
shift @optionlist);
|
||||
$configfile .= sprintf(",%d,0x%02x", shift @optionlist,
|
||||
shift @optionlist) while @optionlist;
|
||||
$configfile .= "\n";
|
||||
}
|
||||
}
|
||||
|
||||
# If we added any module option to handle aliases, we need to load all
|
||||
# the adapter drivers so that the numbers will be the same. If not, then
|
||||
# we only load the adapter drivers which are useful.
|
||||
|
Loading…
x
Reference in New Issue
Block a user