can: mcp251x: fix support for half duplex SPI host controllers
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 30 Mar 2021 09:46:07 +0000 (11:46 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 6 Apr 2021 10:31:21 +0000 (12:31 +0200)
commit617085fca6375e2c1667d1fbfc6adc4034c85f04
treeded19c17fed5c597d28d842d4c8e0bd7385263d9
parent08c27f3322fec11950b8f1384aa0f3b11d028528
can: mcp251x: fix support for half duplex SPI host controllers

Some SPI host controllers do not support full-duplex SPI transfers.

The function mcp251x_spi_trans() does a full duplex transfer. It is
used in several places in the driver, where a TX half duplex transfer
is sufficient.

To fix support for half duplex SPI host controllers, this patch
introduces a new function mcp251x_spi_write() and changes all callers
that do a TX half duplex transfer to use mcp251x_spi_write().

Fixes: e0e25001d088 ("can: mcp251x: add support for half duplex controllers")
Link: https://lore.kernel.org/r/20210330100246.1074375-1-mkl@pengutronix.de
Cc: Tim Harvey <tharvey@gateworks.com>
Tested-By: Tim Harvey <tharvey@gateworks.com>
Reported-by: Gerhard Bertelsmann <info@gerhard-bertelsmann.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251x.c