aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/spi/adesto.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/spi/adesto.c')
-rw-r--r--src/drivers/spi/adesto.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/spi/adesto.c b/src/drivers/spi/adesto.c
index 91bb774e36..52a74f97bd 100644
--- a/src/drivers/spi/adesto.c
+++ b/src/drivers/spi/adesto.c
@@ -12,6 +12,7 @@
#include <console/console.h>
#include <stdlib.h>
+#include <string.h>
#include <spi_flash.h>
#include <spi-generic.h>
@@ -108,13 +109,13 @@ static int adesto_write(const struct spi_flash *flash, u32 offset, size_t len,
cmd[0], cmd[1], cmd[2], cmd[3], chunk_len);
#endif
- ret = spi_flash_cmd(flash->spi, CMD_AT25DF_WREN, NULL, 0);
+ ret = spi_flash_cmd(&flash->spi, CMD_AT25DF_WREN, NULL, 0);
if (ret < 0) {
printk(BIOS_WARNING, "SF: Enabling Write failed\n");
goto out;
}
- ret = spi_flash_cmd_write(flash->spi, cmd, sizeof(cmd),
+ ret = spi_flash_cmd_write(&flash->spi, cmd, sizeof(cmd),
buf + actual, chunk_len);
if (ret < 0) {
printk(BIOS_WARNING, "SF: adesto Page Program failed\n");
@@ -165,7 +166,7 @@ struct spi_flash *spi_flash_probe_adesto(struct spi_slave *spi, u8 *idcode)
}
stm->params = params;
- stm->flash.spi = spi;
+ memcpy(&stm->flash.spi, spi, sizeof(*spi));
stm->flash.name = params->name;
/* Assuming power-of-two page size initially. */