2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 14:25:39 +00:00

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.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5847 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2010-07-05 16:50:27 +00:00
parent 8deb0ac382
commit cb76d5af68

View File

@@ -2951,14 +2951,9 @@ use vars qw(%chips_detected);
sub add_i2c_to_chips_detected
{
my ($chipdriver, $datahash) = @_;
my ($i, $new_detected_ref, $detected_ref, $detected_entry,
my ($i, $detected_ref, $detected_entry,
$put_in_detected, @hash_addrs, @entry_addrs);
# First determine where the hash has to be added.
$chips_detected{$chipdriver} = []
unless exists $chips_detected{$chipdriver};
$new_detected_ref = $chips_detected{$chipdriver};
# Find out whether our new entry should go into the detected list
# or not. We compare all i2c addresses; if at least one matches,
# but our confidence value is lower, we assume this is a misdetection,
@@ -3003,7 +2998,9 @@ sub add_i2c_to_chips_detected
}
# Now add the new entry to detected
push @$new_detected_ref, $datahash;
$chips_detected{$chipdriver} = []
unless exists $chips_detected{$chipdriver};
push @{$chips_detected{$chipdriver}}, $datahash;
}
# This adds a detection to the above structure.