layout: Verify that regions to be written are granularity aligned

This will be important with the new erase/write strategy when we don't
write per erase block anymore.

Change-Id: Ie3c74ff4313c9d72ac92d3226804e0407088c17d
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72546
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/flashrom.c b/flashrom.c
index 4258018..2b5c571 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -401,7 +401,7 @@
 	return ret;
 }
 
-static size_t gran_to_bytes(const enum write_granularity gran)
+size_t gran_to_bytes(const enum write_granularity gran)
 {
 	switch (gran) {
 		case write_gran_1bit:			return 1;
@@ -1488,7 +1488,7 @@
 		return 1;
 	}
 
-	if (layout_sanity_checks(flash)) {
+	if (layout_sanity_checks(flash, write_it)) {
 		msg_cerr("Requested regions can not be handled. Aborting.\n");
 		return 1;
 	}