Changeset 5221

Show
Ignore:
Timestamp:
05/02/08 13:57:03 (2 months ago)
Author:
khali
Message:

We now always prefer ISA access over I2C/SMBus access, so we can
simplify the code a bit.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect

    r5214 r5221  
    55715571} 
    55725572 
    5573 # $_[0]: 1 if ISA bus is prefered, 0 for SMBus 
    55745573# We build here an array adapters, indexed on the number the adapter has 
    55755574# at this moment (we assume only loaded adapters are interesting at all; 
     
    55835582sub generate_modprobes 
    55845583{ 
    5585   my ($prefer_isa) = @_; 
    5586  
    55875584  my ($chip,$detection,$nr,$i,@optionlist,@probelist,$driver,$isa,$adap); 
    55885585  my $ipmi = 0; 
     
    55995596      if (exists $detection->{i2c_driver} and 
    56005597          not exists $i2c_adapters[$detection->{i2c_devnr}]->{nr_later} and  
    5601           not (exists $detection->{isa_addr} and $prefer_isa)) { 
     5598          not exists $detection->{isa_addr}) { # Always use ISA access if possible 
    56025599         foreach $adap (@i2c_adapters) { 
    56035600           next unless exists $adap->{driver}; 
     
    56055602         } 
    56065603      } 
    5607       if (exists $detection->{isa_addr} and 
    5608           not (exists $detection->{i2c_driver} and not $prefer_isa)) { 
     5604      if (exists $detection->{isa_addr}) { 
    56095605           $isa=1; 
    56105606      } 
     
    56805676              exists $i2c_adapters[$detection->{i2c_devnr}]->{nr_later}; 
    56815677      push @optionlist, -1, $detection->{isa_addr} 
    5682            if exists $detection->{isa_addr} and $isa
     5678           if exists $detection->{isa_addr}
    56835679    } 
    56845680 
     
    56875683      if (exists $detection->{i2c_driver} and  
    56885684          exists $detection->{isa_addr} and 
    5689           exists $i2c_adapters[$detection->{i2c_devnr}]->{nr_later} and 
    5690           $isa) { 
    5691         if ($prefer_isa) { 
    5692           push @optionlist, $i2c_adapters[$detection->{i2c_devnr}]->{nr_later}, 
    5693                            $detection->{i2c_addr}; 
    5694         } else { 
    5695           push @optionlist, -1, $detection->{isa_addr} 
    5696         } 
     5685          exists $i2c_adapters[$detection->{i2c_devnr}]->{nr_later}) { 
     5686        push @optionlist, $i2c_adapters[$detection->{i2c_devnr}]->{nr_later}, 
     5687                          $detection->{i2c_addr}; 
    56975688      } 
    56985689    } 
     
    59155906  print "\n"; 
    59165907 
    5917   my ($modprobes, $configfile) = generate_modprobes 1; # 1 == prefer ISA 
     5908  my ($modprobes, $configfile) = generate_modprobes(); 
    59185909 
    59195910  if (defined $configfile) {