boot: Fix ifdefs in DIRECT_XIP and RAM_LOAD case
The function `boot_erase_region` is used in some cases when DIRECT_XIP
or RAM_LOAD are defined, however it is specifically not compiled in in
these cases. Correct the ifdefs so this function will be available.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c
index 728c872..9252b89 100644
--- a/boot/bootutil/src/loader.c
+++ b/boot/bootutil/src/loader.c
@@ -857,6 +857,7 @@
return swap_type;
}
+#endif
/**
* Erases a region of flash.
@@ -874,6 +875,7 @@
return flash_area_erase(fap, off, sz);
}
+#if !defined(MCUBOOT_DIRECT_XIP) && !defined(MCUBOOT_RAM_LOAD)
/**
* Copies the contents of one flash region to another. You must erase the
* destination region prior to calling this function.