Edward O'Callaghan has uploaded this change for review.

View Change

flashrom.c: Make {un}map_flash() static local [WIP]

Change-Id: Ib45bfd294acf72bb0cae4ae6b9137029e7702697
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M flashrom.c
M include/flash.h
M sb600spi.c
3 files changed, 13 insertions(+), 5 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/63/67363/1
diff --git a/flashrom.c b/flashrom.c
index acc8f52..479d442 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -619,7 +619,7 @@
return limitexceeded;
}

-void unmap_flash(struct flashctx *flash)
+static void unmap_flash(struct flashctx *flash)
{
if (flash->virtual_registers != (chipaddr)ERROR_PTR) {
programmer_unmap_flash_region((void *)flash->virtual_registers, flash->chip->total_size * 1024);
@@ -634,7 +634,7 @@
}
}

-int map_flash(struct flashctx *flash)
+static int map_flash(struct flashctx *flash)
{
/* Init pointers to the fail-safe state to distinguish them later from legit values. */
flash->virtual_memory = (chipaddr)ERROR_PTR;
diff --git a/include/flash.h b/include/flash.h
index d1656e9..a894cfe 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -409,8 +409,6 @@
extern const char flashrom_version[];
extern const char *chip_to_probe;
char *flashbuses_to_text(enum chipbustype bustype);
-int map_flash(struct flashctx *flash);
-void unmap_flash(struct flashctx *flash);
int read_memmapped(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int erase_flash(struct flashctx *flash);
int probe_flash(const struct flashrom_programmer *const flashprog, struct registered_master *mst, int startchip, struct flashctx *fill_flash, int force);
diff --git a/sb600spi.c b/sb600spi.c
index f218ca6..a5ac545 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -575,7 +575,7 @@
{
struct sb600spi_data * data = (struct sb600spi_data *)flash->mst->spi.data;
if (!data->flash) {
- map_flash(flash);
+ //map_flash(flash);
data->flash = flash; /* keep a copy of flashctx for unmap() on tear-down. */
}
mmio_readn((void *)(flash->virtual_memory + start), buf, len);

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

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