linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: dw: Replace spi->chip_select references with function calls
@ 2023-05-15 13:03 Amit Kumar Mahapatra
  2023-05-15 13:35 ` Serge Semin
  2023-05-16 11:37 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Amit Kumar Mahapatra @ 2023-05-15 13:03 UTC (permalink / raw)
  To: broonie
  Cc: blarson, git, fancer.lancer, linux-spi, linux-kernel,
	amitrkcian2002, Amit Kumar Mahapatra

New set/get APIs for accessing spi->chip_select were introduced by
'commit 9e264f3f85a5 ("spi: Replace all spi->chip_select and spi->cs_gpiod
references with function call")', but the 'commit 2c8606040a80 ("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>
---
BRANCH: for-next
---
 drivers/spi/spi-dw-mmio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 5e6faa98aa85..5f2aee69c1c1 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -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,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: dw: Replace spi->chip_select references with function calls
  2023-05-15 13:03 [PATCH] spi: dw: Replace spi->chip_select references with function calls Amit Kumar Mahapatra
@ 2023-05-15 13:35 ` Serge Semin
  2023-05-16 11:37 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Serge Semin @ 2023-05-15 13:35 UTC (permalink / raw)
  To: Amit Kumar Mahapatra
  Cc: broonie, blarson, git, linux-spi, linux-kernel, amitrkcian2002

On Mon, May 15, 2023 at 06:33:43PM +0530, Amit Kumar Mahapatra wrote:
> New set/get APIs for accessing spi->chip_select were introduced by
> 'commit 9e264f3f85a5 ("spi: Replace all spi->chip_select and spi->cs_gpiod
> references with function call")', but the 'commit 2c8606040a80 ("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.

Indeed. I've absolutely missed that part. Thanks for the patch.

Acked-by: Serge Semin <fancer.lancer@gmail.com>

-Serge(y)

> 
> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> ---
> BRANCH: for-next
> ---
>  drivers/spi/spi-dw-mmio.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
> index 5e6faa98aa85..5f2aee69c1c1 100644
> --- a/drivers/spi/spi-dw-mmio.c
> +++ b/drivers/spi/spi-dw-mmio.c
> @@ -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,
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: dw: Replace spi->chip_select references with function calls
  2023-05-15 13:03 [PATCH] spi: dw: Replace spi->chip_select references with function calls Amit Kumar Mahapatra
  2023-05-15 13:35 ` Serge Semin
@ 2023-05-16 11:37 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-05-16 11:37 UTC (permalink / raw)
  To: Amit Kumar Mahapatra
  Cc: blarson, git, fancer.lancer, linux-spi, linux-kernel, amitrkcian2002

On Mon, 15 May 2023 18:33:43 +0530, Amit Kumar Mahapatra wrote:
> New set/get APIs for accessing spi->chip_select were introduced by
> 'commit 9e264f3f85a5 ("spi: Replace all spi->chip_select and spi->cs_gpiod
> references with function call")', but the 'commit 2c8606040a80 ("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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: dw: Replace spi->chip_select references with function calls
      commit: 445164e8c136f1445caf735d6d268c948e71caf1

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-16 11:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15 13:03 [PATCH] spi: dw: Replace spi->chip_select references with function calls Amit Kumar Mahapatra
2023-05-15 13:35 ` Serge Semin
2023-05-16 11:37 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).