Browse Source

Move dimm list creation to a separate function.

git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5690 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.3
Jean Delvare 17 years ago
parent
commit
6c15d67bf7
  1. 11
      eeprom/decode-dimms

11
eeprom/decode-dimms

@ -1612,8 +1612,11 @@ Jean Delvare, Trent Piepho and others');
my $dimm_count = 0;
my $dir;
if (!$use_hexdump) {
sub get_dimm_list
{
my $dir;
if ($use_sysfs) {
$dir = '/sys/bus/i2c/drivers/eeprom';
} else {
@ -1621,13 +1624,15 @@ if (!$use_hexdump) {
}
if (-d $dir) {
@dimm_list = split(/\s+/, `ls $dir`);
return split(/\s+/, `ls $dir`);
} elsif (! -d '/sys/module/eeprom') {
print "No EEPROM found, are you sure the eeprom module is loaded?\n";
exit;
}
}
@dimm_list = get_dimm_list() unless $use_hexdump;
for my $i (0 .. $#dimm_list) {
$_ = $dimm_list[$i];
if (($use_sysfs && /^\d+-\d+$/)

Loading…
Cancel
Save