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/sst28sf040.c b/sst28sf040.c
index 6c22591..ab57835 100644
--- a/sst28sf040.c
+++ b/sst28sf040.c
@@ -115,7 +115,7 @@
 int erase_chip_28sf040(struct flashctx *flash, unsigned int addr,
 		       unsigned int blocklen)
 {
-	if ((addr != 0) || (blocklen != flash->chip->total_size * 1024)) {
+	if ((addr != 0) || (blocklen != flashprog_flash_getsize(flash))) {
 		msg_cerr("%s called with incorrect arguments\n",
 			__func__);
 		return -1;