Re: [RFC PATCH 1/6] spi: Extend the core to ease integration of SPI memory controllers

Mark Brown
2018-02-19T14:00:27Z

[-- Attachment #1: Type: text/plain, Size: 838 bytes --]

On Tue, Feb 06, 2018 at 12:21:15AM +0100, Boris Brezillon wrote:

> + /*
> + * The controller can implement only the high-level SPI-memory like
> + * operations if it does not support regular SPI transfers.
> + */
> + if (ctlr->mem_ops) {
> + if (!ctlr->mem_ops->supports_op ||
> + !ctlr->mem_ops->exec_op)
> + return -EINVAL;
> + } else if (!ctlr->transfer && !ctlr->transfer_one &&
> + !ctlr->transfer_one_message) {
> + return -EINVAL;
> + }

BTW your comment isn't describing what the code does - the comment says
that having the memory operations means the driver can't be a regular
SPI controller while the code does not do that and only checks that if a
driver has memory ops it implements two required ones. Indeed the
existing drivers that are updated to the new API continue to implement
normal SPI operations.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]