Changeset 5847

Show
Ignore:
Timestamp:
07/05/10 18:50:27 (3 years ago)
Author:
khali
Message:

Don't create entries for new drivers before we have something to
add to them. If we have multiple detections at the same I2C
address, one will be discarded so its driver shouldn't be recorded.

Files:
1 modified

Legend:

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

    r5845 r5847  
    29522952{ 
    29532953        my ($chipdriver, $datahash) = @_; 
    2954         my ($i, $new_detected_ref, $detected_ref, $detected_entry, 
     2954        my ($i, $detected_ref, $detected_entry, 
    29552955            $put_in_detected, @hash_addrs, @entry_addrs); 
    2956  
    2957         # First determine where the hash has to be added. 
    2958         $chips_detected{$chipdriver} = [] 
    2959                 unless exists $chips_detected{$chipdriver}; 
    2960         $new_detected_ref = $chips_detected{$chipdriver}; 
    29612956 
    29622957        # Find out whether our new entry should go into the detected list 
     
    30042999 
    30053000        # Now add the new entry to detected 
    3006         push @$new_detected_ref, $datahash; 
     3001        $chips_detected{$chipdriver} = [] 
     3002                unless exists $chips_detected{$chipdriver}; 
     3003        push @{$chips_detected{$chipdriver}}, $datahash; 
    30073004} 
    30083005