From a400554d4d2960edf16d40a4fcc8040b3e2f6d74 Mon Sep 17 00:00:00 2001 From: hailfinger Date: Sat, 19 Jul 2014 22:03:29 +0000 Subject: 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. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Tauner git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1831 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- cli_classic.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'cli_classic.c') 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; -- cgit v1.2.1