From beaefe0f96758297d013bd48b598225410b44e34 Mon Sep 17 00:00:00 2001 From: dhendrix Date: Sun, 3 Sep 2017 18:06:53 -0700 Subject: Move get_layout() from flashrom.c to layout.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic67cf53abddc0aa905674acbcde717d9aed2f66e Signed-off-by: David Hendricks Reviewed-on: https://review.coreboot.org/21367 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- layout.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'layout.c') diff --git a/layout.c b/layout.c index 9bf0b038..7ce7c579 100644 --- a/layout.c +++ b/layout.c @@ -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) { -- cgit v1.2.3