]> git.baikalelectronics.ru Git - kernel.git/commit
spi: dw: Fix spi registration for controllers overriding CS
authorLars Povlsen <lars.povlsen@microchip.com>
Fri, 20 Nov 2020 21:34:14 +0000 (22:34 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 25 Nov 2020 12:54:05 +0000 (12:54 +0000)
commitf170b1900dec5919ef7f2907301615bb1c355b8d
tree47f3d5af55c6df93a0b24334c1bcf929095935b1
parent1f6e4f8aebbbb15ea5d0b347c0c1f4d4f7487071
spi: dw: Fix spi registration for controllers overriding CS

When SPI DW memory ops support was introduced, there was a check for
excluding controllers which supplied their own CS function. Even so,
the mem_ops pointer is *always* presented to the SPI core.

This causes the SPI core sanity check in spi_controller_check_ops() to
refuse registration, since a mem_ops pointer is being supplied without
an exec_op member function.

The end result is failure of the SPI DW driver on sparx5 and similar
platforms.

The fix in the core SPI DW driver is to avoid presenting the mem_ops
pointer if the exec_op function is not set.

Fixes: 7d4368680c5a (spi: dw: Add memory operations support)
Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20201120213414.339701-1-lars.povlsen@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-core.c