Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/68297 )
Change subject: layout: Move init_default_layout() into layout.c ......................................................................
layout: Move init_default_layout() into layout.c
Change-Id: I48c07b05c80eb38852d825100ddec48b3c686b50 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M flashrom.c M include/layout.h M layout.c 3 files changed, 22 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/97/68297/1
diff --git a/flashrom.c b/flashrom.c index 3575822..21b5e73 100644 --- a/flashrom.c +++ b/flashrom.c @@ -761,17 +761,6 @@ return ret; }
-static int init_default_layout(struct flashctx *flash) -{ - /* Fill default layout covering the whole chip. */ - if (flashrom_layout_new(&flash->default_layout) || - flashrom_layout_add_region(flash->default_layout, - 0, flash->chip->total_size * 1024 - 1, "complete flash") || - flashrom_layout_include_region(flash->default_layout, "complete flash")) - return -1; - return 0; -} - int probe_flash(struct registered_master *mst, int startchip, struct flashctx *flash, int force) { const struct flashchip *chip; diff --git a/include/layout.h b/include/layout.h index abbdc22..573d38d 100644 --- a/include/layout.h +++ b/include/layout.h @@ -50,6 +50,7 @@ struct layout_include_args;
struct flashrom_flashctx; +int init_default_layout(struct flashrom_flashctx *flash); const struct flashrom_layout *get_default_layout(const struct flashrom_flashctx *); const struct flashrom_layout *get_layout(const struct flashrom_flashctx *);
diff --git a/layout.c b/layout.c index be88428..def86ea 100644 --- a/layout.c +++ b/layout.c @@ -35,6 +35,17 @@ struct layout_include_args *next; };
+int init_default_layout(struct flashrom_flashctx *flash) +{ + /* Fill default layout covering the whole chip. */ + if (flashrom_layout_new(&flash->default_layout) || + flashrom_layout_add_region(flash->default_layout, + 0, flash->chip->total_size * 1024 - 1, "complete flash") || + flashrom_layout_include_region(flash->default_layout, "complete flash")) + return -1; + return 0; +} + const struct flashrom_layout *get_default_layout(const struct flashrom_flashctx *const flashctx) { return flashctx->default_layout;