diff options
author | dhendrix <dhendrix@chromium.org> | 2017-09-03 18:06:53 -0700 |
---|---|---|
committer | David Hendricks <david.hendricks@gmail.com> | 2017-10-17 06:49:59 +0000 |
commit | beaefe0f96758297d013bd48b598225410b44e34 (patch) | |
tree | 044fcb25328c80d0c57a9bc5b07cf60be9810ab7 | |
parent | af111e25a9d00c3d99eae6196c616461cfdfb193 (diff) | |
download | flashrom-beaefe0f96758297d013bd48b598225410b44e34.tar.gz flashrom-beaefe0f96758297d013bd48b598225410b44e34.tar.bz2 flashrom-beaefe0f96758297d013bd48b598225410b44e34.zip |
Move get_layout() from flashrom.c to layout.c
Change-Id: Ic67cf53abddc0aa905674acbcde717d9aed2f66e
Signed-off-by: David Hendricks <david.hendricks@gmail.com>
Reviewed-on: https://review.coreboot.org/21367
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | flashrom.c | 8 | ||||
-rw-r--r-- | layout.c | 8 | ||||
-rw-r--r-- | layout.h | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/flashrom.c b/flashrom.c index 4f17382dc..4fe184320 100644 --- a/flashrom.c +++ b/flashrom.c @@ -1529,14 +1529,6 @@ static int check_block_eraser(const struct flashctx *flash, int k, int log) return 0; } -static const struct flashrom_layout *get_layout(const struct flashctx *const flashctx) -{ - if (flashctx->layout && flashctx->layout->num_entries) - return flashctx->layout; - else - return &flashctx->fallback_layout.base; -} - /** * @brief Reads the included layout regions into a buffer. * @@ -40,6 +40,14 @@ struct flashrom_layout *get_global_layout(void) return &layout; } +const struct flashrom_layout *get_layout(const struct flashrom_flashctx *const flashctx) +{ + if (flashctx->layout && flashctx->layout->num_entries) + return flashctx->layout; + else + return &flashctx->fallback_layout.base; +} + #ifndef __LIBPAYLOAD__ int read_romlayout(const char *name) { @@ -58,6 +58,8 @@ struct single_layout { }; struct flashrom_layout *get_global_layout(void); +struct flashrom_flashctx; +const struct flashrom_layout *get_layout(const struct flashrom_flashctx *const flashctx); int process_include_args(struct flashrom_layout *); |