[PATCH] mtd: spi-nor: rename method for enabling or disabling octal DTR

Michael Walle mwalle at kernel.org
Tue Jul 18 02:28:53 PDT 2023


Btw. this was threaded within another thread. At least on the
netdev (and spi) ML this is discouraged.

Am 2023-07-14 17:07, schrieb Tudor Ambarus:
> 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();
> }
> 

I don't care much for this naming. I've also seen _enable() functions
which take a bool and then actually disable something in the kernel.

So I'm fine either way:

Reviewed-by: Michael Walle <mwalle at kernel.org>

-michael



More information about the linux-mtd mailing list