summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/agesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/northbridge/amd/agesa')
-rw-r--r--src/northbridge/amd/agesa/oem_s3.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/northbridge/amd/agesa/oem_s3.c b/src/northbridge/amd/agesa/oem_s3.c
index e3d58c21d0..02c384ac8b 100644
--- a/src/northbridge/amd/agesa/oem_s3.c
+++ b/src/northbridge/amd/agesa/oem_s3.c
@@ -96,20 +96,19 @@ AGESA_STATUS OemS3LateRestore(AMD_S3_PARAMS *dataBlock)
static int spi_SaveS3info(u32 pos, u32 size, u8 *buf, u32 len)
{
#if IS_ENABLED(CONFIG_SPI_FLASH)
- struct spi_flash *flash;
+ struct spi_flash flash;
spi_init();
- flash = spi_flash_probe(0, 0);
- if (!flash)
+ if (spi_flash_probe(0, 0, &flash))
return -1;
- spi_flash_volatile_group_begin(flash);
+ spi_flash_volatile_group_begin(&flash);
- spi_flash_erase(flash, pos, size);
- spi_flash_write(flash, pos, sizeof(len), &len);
- spi_flash_write(flash, pos + sizeof(len), len, buf);
+ spi_flash_erase(&flash, pos, size);
+ spi_flash_write(&flash, pos, sizeof(len), &len);
+ spi_flash_write(&flash, pos + sizeof(len), len, buf);
- spi_flash_volatile_group_end(flash);
+ spi_flash_volatile_group_end(&flash);
return 0;
#else
return -1;