Use flashprog_flash_getsize() where possible
Change-Id: I4eab12dc9dcf0c7fdffc5c662081868c6f32e36c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/493
diff --git a/libflashprog.c b/libflashprog.c
index 212293f..4f258b5 100644
--- a/libflashprog.c
+++ b/libflashprog.c
@@ -308,7 +308,7 @@
/* Fill default layout covering the whole chip. */
if (flashprog_layout_new(&flash->default_layout) ||
flashprog_layout_add_region(flash->default_layout,
- 0, flash->chip->total_size * 1024 - 1, "complete flash") ||
+ 0, flashprog_flash_getsize(flash) - 1, "complete flash") ||
flashprog_layout_include_region(flash->default_layout, "complete flash")) {
flashprog_flash_release(flash);
return 1;