Re: [PATCH v5 12/13] spi: mxic: Use spi_mem_generic_supports_op()

Miquel Raynal
2021-12-16T14:28:08Z

Hi Mark,

broonie@kernel.org wrote on Thu, 16 Dec 2021 14:04:18 +0000:

> On Thu, Dec 16, 2021 at 10:57:39AM +0100, Miquel Raynal wrote:
>
> > Actually as the spi-mem.h header is not included in spi.h, it makes
> > defining a static mem_caps entry harder. I'll go for another approach.
> > Maybe putting the capabilities within the spi_controller_mem_ops
> > structure, as these are highly related.
>
> Yeah, or putting a pointer to a static declaration of the caps in there
> rather than the caps directly.

Yeah, that's what I ended up doing. Each controller driver supporting
mem-ops must provide a capabilities structure. Drivers without specific
capabilities can just reference the static &spi_mem_no_caps struct
instead of defining their empty one.

Thanks,
Miquèl