David Hendricks merged this change.

View Change

Approvals: Philippe Mathieu-Daudé: Looks good to me, but someone else must approve Nico Huber: Looks good to me, approved build bot (Jenkins): Verified
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>
---
M flashrom.c
M layout.c
M layout.h
3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/flashrom.c b/flashrom.c
index 4f17382..4fe1843 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1529,14 +1529,6 @@
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.
*
diff --git a/layout.c b/layout.c
index 9bf0b03..7ce7c57 100644
--- a/layout.c
+++ b/layout.c
@@ -40,6 +40,14 @@
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)
{
diff --git a/layout.h b/layout.h
index f32dc82..fd1049d 100644
--- a/layout.h
+++ b/layout.h
@@ -58,6 +58,8 @@
};

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 *);

To view, visit change 21367. To unsubscribe, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic67cf53abddc0aa905674acbcde717d9aed2f66e
Gerrit-Change-Number: 21367
Gerrit-PatchSet: 7
Gerrit-Owner: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <f4bug@amsat.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>