mtd: spi-nor: Regroup flash parameter and settings
authorTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 23 Aug 2019 15:53:35 +0000 (15:53 +0000)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Wed, 28 Aug 2019 09:40:26 +0000 (12:40 +0300)
commit47599127a2e8c42843e27fc370e63cc5344a2a38
treed736199e3249cb85ce21bf23c7a87179e5eb562a
parent92b6d38f1a3d59fb43d36c2d9681b9b8f1e46c05
mtd: spi-nor: Regroup flash parameter and settings

The scope is to move all [FLASH-SPECIFIC] parameters and settings
from 'struct spi_nor' to 'struct spi_nor_flash_parameter'.

'struct spi_nor_flash_parameter' describes the hardware capabilities
and associated settings of the SPI NOR flash memory. It includes
legacy flash parameters and settings that can be overwritten by the
spi_nor_fixups hooks, or dynamically when parsing the JESD216
Serial Flash Discoverable Parameters (SFDP) tables. All SFDP params
and settings will fit inside 'struct spi_nor_flash_parameter'.

Move spi_nor_hwcaps related code to avoid forward declarations.
Add a forward declaration that we can't avoid: 'struct spi_nor' will
be used in 'struct spi_nor_flash_parameter'.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
drivers/mtd/spi-nor/spi-nor.c
include/linux/mtd/spi-nor.h