summaryrefslogtreecommitdiffstats
path: root/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/layout.c b/layout.c
index 9bf0b038f..7ce7c579f 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)
{