mtd: spi-nor: rename method for enabling or disabling octal DTR
authorTudor Ambarus <tudor.ambarus@linaro.org>
Fri, 14 Jul 2023 15:07:57 +0000 (18:07 +0300)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Tue, 18 Jul 2023 17:40:51 +0000 (20:40 +0300)
commitd4996700abc18efcd7d933ecfbc5f066153e74ff
treefbf9bb9a58ed89e1d6680daac0e65a00e004767c
parent83e824a4a595132f9bd7ac4f5afff857bfc5991e
mtd: spi-nor: rename method for enabling or disabling octal DTR

Having an *_enable(..., bool enable) definition was misleading
as the method is used both to enable and to disable the octal DTR
mode. Splitting the method in the core in two, one to enable and
another to disable the octal DTR mode does not make sense as the
method is straight forward and we'd introduce code duplication.

Update the core to use:
int (*set_octal_dtr)(struct spi_nor *nor, bool enable);

Manufacturer drivers use different sequences of commands to enable
and disable the octal DTR mode, thus for clarity they shall
implement it as:
static int manufacturer_snor_set_octal_dtr(struct spi_nor *nor, bool enable)
{
return enable ? manufacturer_snor_octal_dtr_enable() :
manufacturer_snor_octal_dtr_disable();
}

Reviewed-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/20230714150757.15372-1-tudor.ambarus@linaro.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/micron-st.c
drivers/mtd/spi-nor/spansion.c