diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2014-07-19 22:03:29 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2014-07-19 22:03:29 +0000 |
commit | a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa (patch) | |
tree | 5daecd880a16b7011be28e064fb7550f3e6b7e58 /cli_classic.c | |
parent | 82b6ec1df30d3fca55547f230c76718d6e613b2a (diff) | |
download | ast2050-flashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.zip ast2050-flashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.tar.gz |
Rename programmer registration functions
Register_programmer suggests that we register a programmer. However,
that function registers a master for a given bus type, and a programmer
may support multiple masters (e.g. SPI, FWH). Rename a few other
functions to be more consistent.
Corresponding to flashrom svn r1831.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'cli_classic.c')
-rw-r--r-- | cli_classic.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/cli_classic.c b/cli_classic.c index fc1b9ba..ee988a3 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -426,10 +426,10 @@ int main(int argc, char *argv[]) msg_pdbg("The following protocols are supported: %s.\n", tempstr); free(tempstr); - for (j = 0; j < registered_programmer_count; j++) { + for (j = 0; j < registered_master_count; j++) { startchip = 0; while (chipcount < ARRAY_SIZE(flashes)) { - startchip = probe_flash(®istered_programmers[j], startchip, &flashes[chipcount], 0); + startchip = probe_flash(®istered_masters[j], startchip, &flashes[chipcount], 0); if (startchip == -1) break; chipcount++; @@ -452,27 +452,27 @@ int main(int argc, char *argv[]) "automatically.\n"); } if (force && read_it && chip_to_probe) { - struct registered_programmer *pgm; - int compatible_programmers = 0; + struct registered_master *mst; + int compatible_masters = 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]; + for (j = 0; j < registered_master_count; j++) { + mst = ®istered_masters[j]; /* chip is still set from the chip_to_probe earlier in this function. */ - if (pgm->buses_supported & chip->bustype) - compatible_programmers++; + if (mst->buses_supported & chip->bustype) + compatible_masters++; } - if (!compatible_programmers) { + if (!compatible_masters) { msg_cinfo("No compatible controller found for the requested flash chip.\n"); ret = 1; goto out_shutdown; } - if (compatible_programmers > 1) + if (compatible_masters > 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); + for (j = 0; j < registered_master_count; j++) { + mst = ®istered_masters[j]; + startchip = probe_flash(mst, 0, &flashes[0], 1); if (startchip != -1) break; } @@ -502,7 +502,7 @@ int main(int argc, char *argv[]) check_chip_supported(fill_flash->chip); size = fill_flash->chip->total_size * 1024; - if (check_max_decode(fill_flash->pgm->buses_supported & fill_flash->chip->bustype, size) && (!force)) { + if (check_max_decode(fill_flash->mst->buses_supported & fill_flash->chip->bustype, size) && (!force)) { msg_cerr("Chip is too big for this programmer (-V gives details). Use --force to override.\n"); ret = 1; goto out_shutdown; |