Changeset 6063

Show
Ignore:
Timestamp:
07/19/12 18:47:54 (10 months ago)
Author:
khali
Message:

Don't choke when no SPD EEPROM is found while the eeprom or at24 driver
is loaded. This can happen, handle the case gracefully.

Location:
i2c-tools/branches/i2c-tools-3.1
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/branches/i2c-tools-3.1/CHANGES

    r6048 r6063  
    55  decode-dimms: Decode module configuration type of DDR2 SDRAM 
    66                Decode bus width extension of DDR3 SDRAM 
     7                Don't choke when no EEPROM is found 
    78  i2c-dev.h: Minimize differences with kernel flavor 
    89             Move SMBus helper functions to include/i2c/smbus.h 
  • i2c-tools/branches/i2c-tools-3.1/eeprom/decode-dimms

    r6043 r6063  
    17401740sub get_dimm_list 
    17411741{ 
    1742         my (@dirs, $dir, $file, @files); 
     1742        my (@dirs, $dir, $opened, $file, @files); 
    17431743 
    17441744        if ($use_sysfs) { 
     
    17501750        foreach $dir (@dirs) { 
    17511751                next unless opendir(local *DIR, $dir); 
     1752                $opened++; 
    17521753                while (defined($file = readdir(DIR))) { 
    17531754                        if ($use_sysfs) { 
     
    17701771        } 
    17711772 
    1772         if (@files) { 
    1773                 return sort { $a->{file} cmp $b->{file} } @files; 
    1774         } elsif (! -d '/sys/module/eeprom') { 
    1775                 print "No EEPROM found, are you sure the eeprom module is loaded?\n"; 
     1773        if (!$opened) { 
     1774                print STDERR "No EEPROM found, try loading the eeprom or at24 module\n"; 
    17761775                exit; 
    17771776        } 
     1777 
     1778        return sort { $a->{file} cmp $b->{file} } @files; 
    17781779} 
    17791780