else if (force && chip_to_probe)
{
struct registered_programmer *pgm;
int compatible_programmers = 0;
msg_cinfo("Force read (-f -r -c) requested, pretending the chip is there:\n");
/* This loop just counts compatible controllers. */
for (j = 0; j < registered_programmer_count; j++) {
pgm = ®istered_programmers[j];
/* chip is still set from the chip_to_probe earlier in this function. */
if (pgm->buses_supported & chip->bustype)
compatible_programmers++;
}
if (!compatible_programmers) {
msg_cinfo("No compatible controller found for the requested flash chip.\n");
ret = 1;
goto out_shutdown;
}
if (compatible_programmers > 1)
msg_cinfo("More than one compatible controller found for the requested flash "
"chip, using the first one.\n");
for (j = 0; j < registered_programmer_count; j++) {
pgm = ®istered_programmers[j];
startchip = probe_flash(pgm, 0, &flashes[0], 1);
if (startchip != -1)
break;
}
msg_cinfo("Please note that forced writes most likely contain garbage.\n");
}
if (startchip == -1) {
ret = 1;
goto out_shutdown;
}
I think it's better to have 'force & force' option to do the writing.