From: Shreeya Patel <shreeya.patel@collabora.com>
To: broonie@kernel.org, sanju.mehta@amd.com
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@collabora.com, krisman@collabora.com,
alvaro.soliverez@collabora.com,
Shreeya Patel <shreeya.patel@collabora.com>
Subject: [PATCH] spi: amd: Fix speed selection
Date: Tue, 30 Aug 2022 15:06:07 +0530 [thread overview]
Message-ID: <20220830093607.45484-1-shreeya.patel@collabora.com> (raw)
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
next reply other threads:[~2022-08-30 9:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 9:36 Shreeya Patel [this message]
2022-08-30 17:59 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220830093607.45484-1-shreeya.patel@collabora.com \
--to=shreeya.patel@collabora.com \
--cc=alvaro.soliverez@collabora.com \
--cc=broonie@kernel.org \
--cc=kernel@collabora.com \
--cc=krisman@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=sanju.mehta@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®