summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi-nor/micron-st.c
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@linaro.org>2023-04-07 09:40:58 +0300
committerTudor Ambarus <tudor.ambarus@linaro.org>2023-04-08 09:30:17 +0300
commite570f7872a34dc290014c80c7bad365d6577836b (patch)
tree60a17aa72e72abb7d89eabc2eb629095d02639f7 /drivers/mtd/spi-nor/micron-st.c
parent120c94a67b26e4014597fc9f872803621e7a2514 (diff)
downloadlinux-e570f7872a34dc290014c80c7bad365d6577836b.tar.xz
mtd: spi-nor: Allow post_sfdp hook to return errors
Multi die flashes like s25hl02gt need to determine the page_size at run-time by querying a configuration register for each die. Since the number of dice is determined in an optional SFDP table, SCCR MC, the page size configuration must be done in the post_sfdp hook. Allow post_sfdp to return errors, as reading the configuration register might return errors. Link: https://lore.kernel.org/r/924ab710f128448ec62537cfbb377336e390043c.1680849425.git.Takahiro.Kuwano@infineon.com Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Diffstat (limited to 'drivers/mtd/spi-nor/micron-st.c')
-rw-r--r--drivers/mtd/spi-nor/micron-st.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
index a6f080112a51..4b919756a205 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -131,7 +131,7 @@ static void mt35xu512aba_default_init(struct spi_nor *nor)
nor->params->octal_dtr_enable = micron_st_nor_octal_dtr_enable;
}
-static void mt35xu512aba_post_sfdp_fixup(struct spi_nor *nor)
+static int mt35xu512aba_post_sfdp_fixup(struct spi_nor *nor)
{
/* Set the Fast Read settings. */
nor->params->hwcaps.mask |= SNOR_HWCAPS_READ_8_8_8_DTR;
@@ -149,6 +149,8 @@ static void mt35xu512aba_post_sfdp_fixup(struct spi_nor *nor)
* disable it.
*/
nor->params->quad_enable = NULL;
+
+ return 0;
}
static const struct spi_nor_fixups mt35xu512aba_fixups = {