All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: amd: Fix speed selection
@ 2022-08-30  9:36 Shreeya Patel
  2022-08-30 17:59 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Shreeya Patel @ 2022-08-30  9:36 UTC (permalink / raw)
  To: broonie, sanju.mehta
  Cc: linux-spi, linux-kernel, kernel, krisman, alvaro.soliverez,
	Shreeya Patel

If the current speed is equal to the requested speed by the device
then return success.
This patch fixes a bug introduced by the commit 3fe26121dc3a
("spi: amd: Configure device speed") which checks speed_hz instead
of amd_spi->speed_hz.

Fixes: 3fe26121dc3a ("spi: amd: Configure device speed")
Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com>
---
 drivers/spi/spi-amd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/spi/spi-amd.c b/drivers/spi/spi-amd.c
index 264633c5ce0b..e23121456c70 100644
--- a/drivers/spi/spi-amd.c
+++ b/drivers/spi/spi-amd.c
@@ -240,9 +240,6 @@ static int amd_set_spi_freq(struct amd_spi *amd_spi, u32 speed_hz)
 {
 	unsigned int i, spd7_val, alt_spd;
 
-	if (speed_hz == amd_spi->speed_hz)
-		return 0;
-
 	if (speed_hz < AMD_SPI_MIN_HZ)
 		return -EINVAL;
 
@@ -250,7 +247,7 @@ static int amd_set_spi_freq(struct amd_spi *amd_spi, u32 speed_hz)
 		if (speed_hz >= amd_spi_freq[i].speed_hz)
 			break;
 
-	if (speed_hz == amd_spi_freq[i].speed_hz)
+	if (amd_spi->speed_hz == amd_spi_freq[i].speed_hz)
 		return 0;
 
 	amd_spi->speed_hz = amd_spi_freq[i].speed_hz;
-- 
2.30.2


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

* Re: [PATCH] spi: amd: Fix speed selection
  2022-08-30  9:36 [PATCH] spi: amd: Fix speed selection Shreeya Patel
@ 2022-08-30 17:59 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-08-30 17:59 UTC (permalink / raw)
  To: sanju.mehta, Shreeya Patel
  Cc: alvaro.soliverez, krisman, linux-spi, kernel, linux-kernel

On Tue, 30 Aug 2022 15:06:07 +0530, Shreeya Patel wrote:
> If the current speed is equal to the requested speed by the device
> then return success.
> This patch fixes a bug introduced by the commit 3fe26121dc3a
> ("spi: amd: Configure device speed") which checks speed_hz instead
> of amd_spi->speed_hz.
> 
> 
> [...]

Applied to

   broonie/spi.git for-next

Thanks!

[1/1] spi: amd: Fix speed selection
      commit: 9477420efc41f60f06413cefa38f5bfd71ba64d8

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] 2+ messages in thread

end of thread, other threads:[~2022-08-30 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30  9:36 [PATCH] spi: amd: Fix speed selection Shreeya Patel
2022-08-30 17:59 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.