diff options
Diffstat (limited to 'src/drivers/spi/stmicro.c')
-rw-r--r-- | src/drivers/spi/stmicro.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/spi/stmicro.c b/src/drivers/spi/stmicro.c index 56181628c6..93d545f396 100644 --- a/src/drivers/spi/stmicro.c +++ b/src/drivers/spi/stmicro.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <spi_flash.h> #include <spi-generic.h> +#include <string.h> #include "spi_flash_internal.h" @@ -204,13 +205,13 @@ static int stmicro_write(const struct spi_flash *flash, buf + actual, cmd[0], cmd[1], cmd[2], cmd[3], chunk_len); #endif - ret = spi_flash_cmd(flash->spi, CMD_M25PXX_WREN, NULL, 0); + ret = spi_flash_cmd(&flash->spi, CMD_M25PXX_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: STMicro Page Program failed\n"); @@ -268,7 +269,7 @@ struct spi_flash *spi_flash_probe_stmicro(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; stm.flash.internal_write = stmicro_write; |