spi25: Replace spi_read_chunked() with more abstract version
The new flashprog_read_chunked() takes a low-level reading function as
argument. This allows us to make use of the chunking with non-SPI read
functions.
Change-Id: Ica1b616e75e4e7682120928588e231c82cf4cf70
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/74865
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/spi.c b/spi.c
index 296e8df..a6b5124 100644
--- a/spi.c
+++ b/spi.c
@@ -80,7 +80,7 @@
"Please report a bug at flashprog@flashprog.org\n", __func__);
return 1;
}
- return spi_read_chunked(flash, buf, start, len, max_data);
+ return flashprog_read_chunked(flash, buf, start, len, max_data, spi_nbyte_read);
}
int default_spi_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)