Changeset 4610

Show
Ignore:
Timestamp:
07/14/07 18:29:52 (6 years ago)
Author:
khali
Message:

Don't add non-sensor I2C chips to the list of detected I2C chips. Even
if we discard them later, their presence in the list can prevent the
"no sensors found" event from triggering. It also causes the script to
suggest loading i2c bus drivers which are not needed for hardware
monitoring.

Files:
1 modified

Legend:

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

    r4604 r4610  
    736736#  driver: The driver name (without .o extension). Put in exactly 
    737737#      "to-be-written" if it is not yet available. Put in exactly 
    738 #      "not-a-sensor" if it is not a hardware monitoring chip and 
    739 #      there is no known driver for it. 
     738#      "not-a-sensor" if it is not a hardware monitoring chip. 
    740739#      Put in exactly "use-isa-instead" if no i2c driver will be written. 
    741740#  i2c_addrs (optional): For I2C chips, the range of valid I2C addresses to 
     
    31133112        printf("\%-60s", sprintf("Probing for `\%s'... ", $chip->{name})); 
    31143113        if (($conf,@chips) = &{$chip->{i2c_detect}} (\*FILE ,$addr)) { 
    3115           print "Success!\n", 
    3116                 "    (confidence $conf, driver `$chip->{driver}')"; 
     3114          if ($chip->{driver} eq "not-a-sensor") { 
     3115            print "Yes\n", 
     3116                  "    (confidence $conf, not a hardware monitoring chip"; 
     3117          } else { 
     3118            print "Success!\n", 
     3119                  "    (confidence $conf, driver `$chip->{driver}'"; 
     3120          } 
    31173121          if (@chips) { 
    31183122            print ", other addresses:"; 
     
    31223126            } 
    31233127          } 
    3124           printf "\n"; 
     3128          printf ")\n"; 
     3129 
     3130          next if ($chip->{driver} eq "not-a-sensor" 
     3131                || $chip->{driver} eq "use-isa-instead"); 
     3132 
    31253133          $new_hash = { conf => $conf, 
    31263134                        i2c_addr => $addr, 
     
    54395447  foreach $chip (@chips_detected) { 
    54405448    next if not @{$chip->{detected}}; 
    5441     next if $chip->{driver} eq "not-a-sensor";     
    5442     next if $chip->{driver} eq "use-isa-instead"; 
    54435449    if ($chip->{driver} eq "to-be-written") { 
    54445450      $modprobes .= "# no driver for $chip->{detected}[0]{chipname} yet\n"; 
     
    56725678  my ($chip,$data); 
    56735679  foreach $chip (@chips_detected) { 
    5674     next if $chip->{driver} eq "not-a-sensor"; 
    5675     next if $chip->{driver} eq "use-isa-instead"; 
    56765680    print "\nDriver `$chip->{driver}' "; 
    56775681    if (@{$chip->{detected}}) {