summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/flashrom.c b/flashrom.c
index a1d0cc2..a51fd63 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -34,6 +34,7 @@ const char *flashrom_version = FLASHROM_VERSION;
char *chip_to_probe = NULL;
int verbose = 0;
enum programmer programmer = PROGRAMMER_INTERNAL;
+char *programmer_param = NULL;
const struct programmer_entry programmer_table[] = {
{
@@ -642,30 +643,32 @@ int main(int argc, char *argv[])
case 'p':
if (strncmp(optarg, "internal", 8) == 0) {
programmer = PROGRAMMER_INTERNAL;
+ if (optarg[8] == '=')
+ programmer_param = strdup(optarg + 9);
} else if (strncmp(optarg, "dummy", 5) == 0) {
programmer = PROGRAMMER_DUMMY;
if (optarg[5] == '=')
- dummytype = strdup(optarg + 6);
+ programmer_param = strdup(optarg + 6);
} else if (strncmp(optarg, "nic3com", 7) == 0) {
programmer = PROGRAMMER_NIC3COM;
if (optarg[7] == '=')
- pcidev_bdf = strdup(optarg + 8);
+ programmer_param = strdup(optarg + 8);
} else if (strncmp(optarg, "satasii", 7) == 0) {
programmer = PROGRAMMER_SATASII;
if (optarg[7] == '=')
- pcidev_bdf = strdup(optarg + 8);
+ programmer_param = strdup(optarg + 8);
} else if (strncmp(optarg, "it87spi", 7) == 0) {
programmer = PROGRAMMER_IT87SPI;
if (optarg[7] == '=')
- it87opts = strdup(optarg + 8);
+ programmer_param = strdup(optarg + 8);
} else if (strncmp(optarg, "ft2232spi", 9) == 0) {
programmer = PROGRAMMER_FT2232SPI;
if (optarg[9] == '=')
- ft2232spi_param = strdup(optarg + 10);
+ programmer_param = strdup(optarg + 10);
} else if (strncmp(optarg, "serprog", 7) == 0) {
programmer = PROGRAMMER_SERPROG;
if (optarg[7] == '=')
- serprog_param = strdup(optarg + 8);
+ programmer_param = strdup(optarg + 8);
} else {
printf("Error: Unknown programmer.\n");
exit(1);
OpenPOWER on IntegriCloud