Commit 83e62ffa authored by Michael Walle's avatar Michael Walle Committed by Tudor Ambarus

mtd: spi-nor: rename .otp_org to .otp and make it a pointer

Move the OTP ops out of the flash_info structure. Besides of saving some
space, there will be a new macro SNOR_OTP() which can be used to set the
ops:
  .otp = SNOR_OTP(...),
Signed-off-by: default avatarMichael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/20230807-mtd-flash-info-db-rework-v3-14-e60548861b10@kernel.orgSigned-off-by: default avatarTudor Ambarus <tudor.ambarus@linaro.org>
parent 2d7f3a08
...@@ -2978,7 +2978,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor) ...@@ -2978,7 +2978,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
struct device_node *np = spi_nor_get_flash_node(nor); struct device_node *np = spi_nor_get_flash_node(nor);
params->quad_enable = spi_nor_sr2_bit1_quad_enable; params->quad_enable = spi_nor_sr2_bit1_quad_enable;
params->otp.org = &info->otp_org; params->otp.org = info->otp;
/* Default to 16-bit Write Status (01h) Command */ /* Default to 16-bit Write Status (01h) Command */
nor->flags |= SNOR_F_HAS_16BIT_SR; nor->flags |= SNOR_F_HAS_16BIT_SR;
......
...@@ -557,7 +557,7 @@ struct flash_info { ...@@ -557,7 +557,7 @@ struct flash_info {
u8 mfr_flags; u8 mfr_flags;
const struct spi_nor_otp_organization otp_org; const struct spi_nor_otp_organization *otp;
const struct spi_nor_fixups *fixups; const struct spi_nor_fixups *fixups;
}; };
...@@ -607,7 +607,7 @@ struct flash_info { ...@@ -607,7 +607,7 @@ struct flash_info {
.flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR, \ .flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR, \
#define OTP_INFO(_len, _n_regions, _base, _offset) \ #define OTP_INFO(_len, _n_regions, _base, _offset) \
.otp_org = { \ .otp = &(const struct spi_nor_otp_organization){ \
.len = (_len), \ .len = (_len), \
.base = (_base), \ .base = (_base), \
.offset = (_offset), \ .offset = (_offset), \
......
...@@ -217,7 +217,7 @@ static int winbond_nor_late_init(struct spi_nor *nor) ...@@ -217,7 +217,7 @@ static int winbond_nor_late_init(struct spi_nor *nor)
{ {
struct spi_nor_flash_parameter *params = nor->params; struct spi_nor_flash_parameter *params = nor->params;
if (params->otp.org->n_regions) if (params->otp.org)
params->otp.ops = &winbond_nor_otp_ops; params->otp.ops = &winbond_nor_otp_ops;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment