Changeset 1479


Ignore:
Timestamp:
12/23/11 00:27:03 (5 months ago)
Author:
mkarcher
Message:

Fix programmer-centric probe (patch v2)

As reported by Stefan Tauner on IRC, the new programmer-centric logic
is broken by re-using occupied members of the flashes array when changing
to the next programmer. This fixes it.

patch v2:

prevent probing one chip per programmer even if the array is full. Using
a do-while loop was a bad idea.

Signed-off-by: Michael Karcher <flashrom@…>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli_classic.c

    r1475 r1479  
    452452        for (j = 0; j < registered_programmer_count; j++) { 
    453453                startchip = 0; 
    454                 for (i = 0; i < ARRAY_SIZE(flashes); i++) { 
     454                while (chipcount < ARRAY_SIZE(flashes)) { 
    455455                        startchip = probe_flash(&registered_programmers[j], 
    456                                                 startchip, &flashes[i], 0); 
     456                                                startchip,  
     457                                                &flashes[chipcount], 0); 
    457458                        if (startchip == -1) 
    458459                                break; 
Note: See TracChangeset for help on using the changeset viewer.