Edward O'Callaghan has uploaded this change for review.

View Change

cli_classic.c: Use flashrom_flash_getname() libflashrom API

TEST=`$ sudo ./flashrom -p internal --flash-name`.

Change-Id: I5270c2cc0c1392d95d497fc1fce266ae082843c2
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M cli_classic.c
1 file changed, 18 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/87/73287/1
diff --git a/cli_classic.c b/cli_classic.c
index da68919..be28495 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -1104,10 +1104,13 @@
}

if (flash_name) {
- if (fill_flash->chip->vendor && fill_flash->chip->name) {
+ char *chip_vendor, *chip_name;
+ flashrom_flash_getname(fill_flash, &chip_vendor, &chip_name);
+ if (chip_vendor && chip_name) {
printf("vendor=\"%s\" name=\"%s\"\n",
- fill_flash->chip->vendor,
- fill_flash->chip->name);
+ chip_vendor, chip_name);
+ free(chip_vendor);
+ free(chip_name);
} else {
ret = -1;
}

To view, visit change 73287. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5270c2cc0c1392d95d497fc1fce266ae082843c2
Gerrit-Change-Number: 73287
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange