Commit d9032b30 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Mark Brown

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: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Link: https://lore.kernel.org/r/20230425134527.483607-2-linux@rasmusvillemoes.dkSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b6e4686c
...@@ -1737,20 +1737,20 @@ static int spi_imx_probe(struct platform_device *pdev) ...@@ -1737,20 +1737,20 @@ static int spi_imx_probe(struct platform_device *pdev)
else else
controller->num_chipselect = 3; controller->num_chipselect = 3;
spi_imx->controller->transfer_one = spi_imx_transfer_one; controller->transfer_one = spi_imx_transfer_one;
spi_imx->controller->setup = spi_imx_setup; controller->setup = spi_imx_setup;
spi_imx->controller->cleanup = spi_imx_cleanup; controller->cleanup = spi_imx_cleanup;
spi_imx->controller->prepare_message = spi_imx_prepare_message; controller->prepare_message = spi_imx_prepare_message;
spi_imx->controller->unprepare_message = spi_imx_unprepare_message; controller->unprepare_message = spi_imx_unprepare_message;
spi_imx->controller->slave_abort = spi_imx_slave_abort; controller->slave_abort = spi_imx_slave_abort;
spi_imx->controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS; controller->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_NO_CS;
if (is_imx35_cspi(spi_imx) || is_imx51_ecspi(spi_imx) || if (is_imx35_cspi(spi_imx) || is_imx51_ecspi(spi_imx) ||
is_imx53_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)) 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) && if (is_imx51_ecspi(spi_imx) &&
device_property_read_u32(&pdev->dev, "cs-gpios", NULL)) device_property_read_u32(&pdev->dev, "cs-gpios", NULL))
...@@ -1759,7 +1759,7 @@ static int spi_imx_probe(struct platform_device *pdev) ...@@ -1759,7 +1759,7 @@ static int spi_imx_probe(struct platform_device *pdev)
* setting the burst length to the word size. This is * setting the burst length to the word size. This is
* considerably faster than manually controlling the CS. * 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; spi_imx->spi_drctl = spi_drctl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment