diff options
Diffstat (limited to 'src/drivers/spi/amic.c')
-rw-r--r-- | src/drivers/spi/amic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/spi/amic.c b/src/drivers/spi/amic.c index 4f3002c73b..42f7cfa120 100644 --- a/src/drivers/spi/amic.c +++ b/src/drivers/spi/amic.c @@ -12,6 +12,7 @@ #include <stdlib.h> #include <spi_flash.h> #include <spi-generic.h> +#include <string.h> #include "spi_flash_internal.h" @@ -90,13 +91,13 @@ static int amic_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_A25_WREN, NULL, 0); + ret = spi_flash_cmd(&flash->spi, CMD_A25_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: AMIC Page Program failed\n"); @@ -147,7 +148,7 @@ struct spi_flash *spi_flash_probe_amic(struct spi_slave *spi, u8 *idcode) } amic->params = params; - amic->flash.spi = spi; + memcpy(&amic->flash.spi, spi, sizeof(*spi)); amic->flash.name = params->name; /* Assuming power-of-two page size initially. */ |