Skip to content

Commit

Permalink
spi: dw: Replace spi->chip_select references with function calls
Browse files Browse the repository at this point in the history
New set/get APIs for accessing spi->chip_select were introduced by
'commit 9e264f3 ("spi: Replace all spi->chip_select and spi->cs_gpiod
references with function call")', but the 'commit 2c86060 ("spi: dw:
Add support for AMD Pensando Elba SoC")' uses the old interface by directly
accessing spi->chip_select. So, replace all spi->chip_select references
in the driver with new get/set APIs.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com
Acked-by: Serge Semin <fancer.lancer@gmail.com
Link: https://lore.kernel.org/r/20230515130343.63770-1-amit.kumar-mahapatra@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org
  • Loading branch information
Amit Kumar Mahapatra authored and Mark Brown committed May 16, 2023
1 parent ec94525 commit 445164e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/spi/spi-dw-mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,17 +264,17 @@ static void dw_spi_elba_set_cs(struct spi_device *spi, bool enable)
struct regmap *syscon = dwsmmio->priv;
u8 cs;

cs = spi->chip_select;
cs = spi_get_chipselect(spi, 0);
if (cs < 2)
dw_spi_elba_override_cs(syscon, spi->chip_select, enable);
dw_spi_elba_override_cs(syscon, spi_get_chipselect(spi, 0), enable);

/*
* The DW SPI controller needs a native CS bit selected to start
* the serial engine.
*/
spi->chip_select = 0;
spi_set_chipselect(spi, 0, 0);
dw_spi_set_cs(spi, enable);
spi->chip_select = cs;
spi_get_chipselect(spi, cs);
}

static int dw_spi_elba_init(struct platform_device *pdev,
Expand Down

0 comments on commit 445164e

Please sign in to comment.