Changeset 5470

Show
Ignore:
Timestamp:
11/30/08 13:53:18 (5 years ago)
Author:
khali
Message:

Rework adapter_pci_detection to require fewer levels of indentation.

Files:
1 modified

Legend:

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

    r5469 r5470  
    22082208        foreach $try (@pci_adapters) { 
    22092209                $key = sprintf("%04x:%04x", $try->{vendid}, $try->{devid}); 
    2210                 if (exists $pci_list{$key}) { 
    2211                         $device = $pci_list{$key}; 
    2212                         if ($try->{driver} =~ m/^to-be-/) { 
    2213                                 printf "No known driver for device \%s: \%s\n", 
    2214                                        pci_busid($device), $try->{procid}; 
    2215  
    2216                                 if ($try->{driver} eq "to-be-tested") { 
    2217                                         print "\nWe are currently looking for testers for this adapter!\n". 
    2218                                               "Please check http://www.lm-sensors.org/wiki/Devices\n". 
    2219                                               "and/or contact us if you want to help.\n\n"; 
    2220                                         print "Continue... "; 
    2221                                         <STDIN>; 
    2222                                         print "\n"; 
    2223                                 } 
    2224                         } else { 
    2225                                 printf "Using driver `\%s' for device \%s: \%s\n", 
    2226                                        $try->{driver}, pci_busid($device), 
    2227                                        $try->{procid}; 
    2228                                 $count++; 
    2229                                 load_module($try->{driver}); 
    2230                         } 
    2231  
    2232                         # Delete from detected SMBus device list 
    2233                         delete $smbus{$key}; 
     2210                next unless exists $pci_list{$key}; 
     2211 
     2212                $device = $pci_list{$key}; 
     2213                if ($try->{driver} eq "to-be-tested") { 
     2214                        print "\nWe are currently looking for testers for this adapter!\n". 
     2215                              "Please check http://www.lm-sensors.org/wiki/Devices\n". 
     2216                              "and/or contact us if you want to help.\n\n". 
     2217                              "Continue... "; 
     2218                        <STDIN>; 
     2219                        print "\n"; 
    22342220                } 
     2221 
     2222                if ($try->{driver} =~ m/^to-be-/) { 
     2223                        printf "No known driver for device \%s: \%s\n", 
     2224                               pci_busid($device), $try->{procid}; 
     2225                } else { 
     2226                        printf "Using driver `\%s' for device \%s: \%s\n", 
     2227                               $try->{driver}, pci_busid($device), 
     2228                               $try->{procid}; 
     2229                        $count++; 
     2230                        load_module($try->{driver}); 
     2231                } 
     2232 
     2233                # Delete from detected SMBus device list 
     2234                delete $smbus{$key}; 
    22352235        } 
    22362236