2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00

Reindent Super-I/O and CPU core detection functions.

git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5475 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-11-30 14:31:03 +00:00
parent 05db7e0c10
commit 15e40f9e18

View File

@@ -2913,7 +2913,8 @@ sub probe_superio
} }
print "Success!\n"; print "Success!\n";
printf " (address 0x\%x, driver `%s')\n", $addr, $chip->{driver}; printf " (address 0x\%x, driver `%s')\n", $addr, $chip->{driver};
my $new_hash = { conf => 9, my $new_hash = {
conf => 9,
isa_addr => $addr, isa_addr => $addr,
chipname => $chip->{name} chipname => $chip->{name}
}; };
@@ -2934,9 +2935,7 @@ sub smsc_ns_detect_superio
# read alternate device ID register # read alternate device ID register
outb($addrreg, 0x0d); outb($addrreg, 0x0d);
$val = inb($datareg); $val = inb($datareg);
if ($val == 0x00 || $val == 0xff) { return 0 if $val == 0x00 || $val == 0xff;
return 0;
}
print "Yes\n"; print "Yes\n";
@@ -2974,6 +2973,7 @@ sub scan_superio
exit_superio($addrreg, $datareg); exit_superio($addrreg, $datareg);
last FAMILY; last FAMILY;
} }
# did it work? # did it work?
outb($addrreg, $superio{devidreg}); outb($addrreg, $superio{devidreg});
$val = inb($datareg); $val = inb($datareg);
@@ -2987,8 +2987,10 @@ sub scan_superio
$found = 0; $found = 0;
foreach my $chip (@{$family->{chips}}) { foreach my $chip (@{$family->{chips}}) {
if (($chip->{devid} > 0xff && ($val & ($chip->{devid_mask} || 0xffff)) == $chip->{devid}) if (($chip->{devid} > 0xff &&
|| ($chip->{devid} <= 0xff && ($val >> 8) == $chip->{devid})) { ($val & ($chip->{devid_mask} || 0xffff)) == $chip->{devid})
|| ($chip->{devid} <= 0xff &&
($val >> 8) == $chip->{devid})) {
probe_superio($addrreg, $datareg, $chip); probe_superio($addrreg, $datareg, $chip);
$found++; $found++;
} }