[PATCH v2] mtd: spi-nor: core: Discard HW capabilities if no enable function

Michael Walle mwalle at kernel.org
Wed Dec 20 01:02:14 PST 2023


Hi,

>>> and these should have been in the late init hook, and instead discard
>>> them from the params->hwcaps.mask.
>> 
>> Maybe there is a better place to mask these bits. But IMHO the core
>> should do it on itself and we shouldn't need to provide an extra
>> hook function for every driver ourselves. The core knows that there
>> is no .octal_enable op and thus it shouldn't even try to enable
>> this mode.
> 
> I meant in the core, at the end of the late_init_params(). Here:
> https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/tree/drivers/mtd/spi-nor/core.c?h=spi-nor/next#n2962

Sounds good.

>> No it is for completeness and correctness. At the moment we are always
>> setting a (random) default quad enable op, due to legacy reasons.
>> 
> 
> Still, the commit message shall indicate this. Can't add extra checks
> out of the blue. Especially since nobody is affected.

Ok :)

-michael



More information about the linux-mtd mailing list