summaryrefslogtreecommitdiff
path: root/src/drivers/spi/gigadevice.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/spi/gigadevice.c')
-rw-r--r--src/drivers/spi/gigadevice.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/spi/gigadevice.c b/src/drivers/spi/gigadevice.c
index 9afc355336..65494fa240 100644
--- a/src/drivers/spi/gigadevice.c
+++ b/src/drivers/spi/gigadevice.c
@@ -13,7 +13,7 @@
*/
#include <console/console.h>
-#include <stdlib.h>
+#include <commonlib/helpers.h>
#include <spi_flash.h>
#include <spi-generic.h>
#include <string.h>
@@ -178,7 +178,7 @@ static int gigadevice_write(const struct spi_flash *flash, u32 offset,
for (actual = 0; actual < len; actual += chunk_len) {
byte_addr = offset % page_size;
- chunk_len = min(len - actual, page_size - byte_addr);
+ chunk_len = MIN(len - actual, page_size - byte_addr);
chunk_len = spi_crop_chunk(&flash->spi, sizeof(cmd), chunk_len);
ret = spi_flash_cmd(&flash->spi, CMD_GD25_WREN, NULL, 0);