From be7be78e10bfca6fc2d5e8fbc71da2db6a55c842 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 28 Apr 2015 13:29:54 +0530 Subject: [PATCH] dm: sf: Save flash flags to struct spi_flash Add a new member 'flags' in struct spi_flash to store the flash flags during spi_flash_validate_params(). Signed-off-by: Bin Meng Reviewed-by: Jagannadha Sutradharudu Teki --- drivers/mtd/spi/sf_probe.c | 3 +++ include/spi_flash.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c index de8d0b7f7c..d8ab6a1ecc 100644 --- a/drivers/mtd/spi/sf_probe.c +++ b/drivers/mtd/spi/sf_probe.c @@ -132,6 +132,9 @@ static int spi_flash_validate_params(struct spi_slave *spi, u8 *idcode, flash->name = params->name; flash->memory_map = spi->memory_map; flash->dual_flash = flash->spi->option; +#ifdef CONFIG_DM_SPI_FLASH + flash->flags = params->flags; +#endif /* Assign spi_flash ops */ #ifndef CONFIG_DM_SPI_FLASH diff --git a/include/spi_flash.h b/include/spi_flash.h index 4791b94281..f2814ef41a 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -65,6 +65,7 @@ struct spi_flash { struct spi_slave *spi; #ifdef CONFIG_DM_SPI_FLASH struct udevice *dev; + u16 flags; #endif const char *name; u8 dual_flash; -- 2.39.5