diff options
author | Jonathon Hall <jonathon.hall@puri.sm> | 2022-10-03 16:19:57 -0400 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2022-10-08 18:45:32 +0000 |
commit | 7c40ba24fe73f820370d99a35ff071d667ef7c74 (patch) | |
tree | 018c486708284151db36a67ce3c4faf221f6d277 | |
parent | a021cd03809ffc08c477e657993d002c96b8541a (diff) | |
download | flashrom-7c40ba24fe73f820370d99a35ff071d667ef7c74.tar.gz flashrom-7c40ba24fe73f820370d99a35ff071d667ef7c74.tar.bz2 flashrom-7c40ba24fe73f820370d99a35ff071d667ef7c74.zip |
flashrom.c: Remove custom mappers from opaque_master
No opaque masters have a custom mapper. The returned chipaddr is not
fed back into the read/write/erase functions, so this would only be
useful for side effects.
Change-Id: I36f05154edda371b51f8ff416f019837ff1c243d
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68092
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r-- | flashrom.c | 12 | ||||
-rw-r--r-- | include/programmer.h | 2 |
2 files changed, 3 insertions, 11 deletions
diff --git a/flashrom.c b/flashrom.c index 90899f059..c5f712a48 100644 --- a/flashrom.c +++ b/flashrom.c @@ -211,9 +211,7 @@ void *master_map_flash_region(const struct registered_master *mst, * fallback if it does not specialize it */ void *(*map_flash_region) (const char *descr, uintptr_t phys_addr, size_t len) = NULL; - if (mst->buses_supported & BUS_PROG) - map_flash_region = mst->opaque.map_flash_region; - else if (mst->buses_supported & BUS_SPI) + if (mst->buses_supported & BUS_SPI) map_flash_region = mst->spi.map_flash_region; else if (mst->buses_supported & BUS_NONSPI) map_flash_region = mst->par.map_flash_region; @@ -232,9 +230,7 @@ void master_unmap_flash_region(const struct registered_master *mst, void *virt_addr, size_t len) { void (*unmap_flash_region) (void *virt_addr, size_t len) = NULL; - if (mst->buses_supported & BUS_PROG) - unmap_flash_region = mst->opaque.unmap_flash_region; - else if (mst->buses_supported & BUS_SPI) + if (mst->buses_supported & BUS_SPI) unmap_flash_region = mst->spi.unmap_flash_region; else if (mst->buses_supported & BUS_NONSPI) unmap_flash_region = mst->par.unmap_flash_region; @@ -249,9 +245,7 @@ void master_unmap_flash_region(const struct registered_master *mst, static bool master_uses_physmap(const struct registered_master *mst) { #if CONFIG_INTERNAL == 1 - if (mst->buses_supported & BUS_PROG) - return mst->opaque.map_flash_region == physmap; - else if (mst->buses_supported & BUS_SPI) + if (mst->buses_supported & BUS_SPI) return mst->spi.map_flash_region == physmap; else if (mst->buses_supported & BUS_NONSPI) return mst->par.map_flash_region == physmap; diff --git a/include/programmer.h b/include/programmer.h index 4b5bf92ac..bfce5d6f0 100644 --- a/include/programmer.h +++ b/include/programmer.h @@ -398,8 +398,6 @@ int wbsio_check_for_spi(void); /* opaque.c */ struct opaque_master { - void *(*map_flash_region) (const char *descr, uintptr_t phys_addr, size_t len); - void (*unmap_flash_region) (void *virt_addr, size_t len); int max_data_read; int max_data_write; /* Specific functions for this master */ |