Changeset 5849

Show
Ignore:
Timestamp:
07/05/10 20:40:44 (4 years ago)
Author:
khali
Message:

Fix r5847 was incomplete. Handling misdetections that happen after
correct detections isn't sufficient, we also have to handle
misdetections which happen first. In that case, we must delete the
driver entry as we remove the last misdetection from it.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/sensors-detect

    r5848 r5849  
    29522952{ 
    29532953        my ($chipdriver, $datahash) = @_; 
    2954         my ($i, $detected_ref, $detected_entry, 
     2954        my ($i, $detected_ref, $detected_entry, $driver, 
    29552955            $put_in_detected, @hash_addrs, @entry_addrs); 
    29562956 
     
    29852985        # sub address. This may not be the best idea to do, as it may remove 
    29862986        # detections without replacing them with second-best ones. Too bad. 
    2987         foreach $detected_ref (values %chips_detected) { 
     2987        foreach $driver (keys %chips_detected) { 
     2988                $detected_ref = $chips_detected{$driver}; 
    29882989                for ($i = @$detected_ref-1; $i >=0; $i--) { 
    29892990                        next unless defined $detected_ref->[$i]->{i2c_addr}; 
     
    29942995                            any_list_match(\@entry_addrs, \@hash_addrs)) { 
    29952996                                splice @$detected_ref, $i, 1; 
     2997                                delete $chips_detected{$driver} 
     2998                                        if (!@$detected_ref); 
    29962999                        } 
    29973000                }