mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-17 22:05:08 +00:00
spi: spi-imx: use "controller" variable consistently in spi_imx_probe()
Near the top of the function, spi_imx->controller is set to controller (and is of course never modified again). The rest of the function uses a mix of the two expressions. For consistency, readability and better code generation, drop all the spi_imx-> indirections. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Link: https://lore.kernel.org/r/20230425134527.483607-2-linux@rasmusvillemoes.dk Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
b6e4686ca8
commit
d9032b3045
@ -1737,20 +1737,20 @@ static int spi_imx_probe(struct platform_device *pdev)
|
||||
else
|
||||
controller->num_chipselect = 3;
|
||||
|
||||
spi_imx->controller->transfer_one = spi_imx_transfer_one;
|
||||
spi_imx->controller->setup = spi_imx_setup;
|
||||
spi_imx->controller->cleanup = spi_imx_cleanup;
|
||||
spi_imx->controller->prepare_message = spi_imx_prepare_message;
|
||||
spi_imx->controller->unprepare_message = spi_imx_unprepare_message;
|
||||
spi_imx->controller->slave_abort = spi_imx_slave_abort;
|
||||
spi_imx->controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS;
|
||||
controller->transfer_one = spi_imx_transfer_one;
|
||||
controller->setup = spi_imx_setup;
|
||||
controller->cleanup = spi_imx_cleanup;
|
||||
controller->prepare_message = spi_imx_prepare_message;
|
||||
controller->unprepare_message = spi_imx_unprepare_message;
|
||||
controller->slave_abort = spi_imx_slave_abort;
|
||||
controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS;
|
||||
|
||||
if (is_imx35_cspi(spi_imx) || is_imx51_ecspi(spi_imx) ||
|
||||
is_imx53_ecspi(spi_imx))
|
||||
spi_imx->controller->mode_bits |= SPI_LOOP | SPI_READY;
|
||||
controller->mode_bits |= SPI_LOOP | SPI_READY;
|
||||
|
||||
if (is_imx51_ecspi(spi_imx) || is_imx53_ecspi(spi_imx))
|
||||
spi_imx->controller->mode_bits |= SPI_RX_CPHA_FLIP;
|
||||
controller->mode_bits |= SPI_RX_CPHA_FLIP;
|
||||
|
||||
if (is_imx51_ecspi(spi_imx) &&
|
||||
device_property_read_u32(&pdev->dev, "cs-gpios", NULL))
|
||||
@ -1759,7 +1759,7 @@ static int spi_imx_probe(struct platform_device *pdev)
|
||||
* setting the burst length to the word size. This is
|
||||
* considerably faster than manually controlling the CS.
|
||||
*/
|
||||
spi_imx->controller->mode_bits |= SPI_CS_WORD;
|
||||
controller->mode_bits |= SPI_CS_WORD;
|
||||
|
||||
spi_imx->spi_drctl = spi_drctl;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user