Changeset 5690

Show
Ignore:
Timestamp:
03/20/09 15:08:17 (4 years ago)
Author:
khali
Message:

Move dimm list creation to a separate function.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/eeprom/decode-dimms

    r5689 r5690  
    16131613 
    16141614my $dimm_count = 0; 
    1615 my $dir; 
    1616 if (!$use_hexdump) { 
     1615 
     1616sub get_dimm_list 
     1617{ 
     1618        my $dir; 
     1619 
    16171620        if ($use_sysfs) { 
    16181621                $dir = '/sys/bus/i2c/drivers/eeprom'; 
     
    16221625 
    16231626        if (-d $dir) { 
    1624                 @dimm_list = split(/\s+/, `ls $dir`); 
     1627                return split(/\s+/, `ls $dir`); 
    16251628        } elsif (! -d '/sys/module/eeprom') { 
    16261629                print "No EEPROM found, are you sure the eeprom module is loaded?\n"; 
     
    16281631        } 
    16291632} 
     1633 
     1634@dimm_list = get_dimm_list() unless $use_hexdump; 
    16301635 
    16311636for my $i (0 .. $#dimm_list) {