From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>
Subject: [PATCH v1 6/7] spi: microchip-core: Use SPI_MODE_X_MASK
Date: Tue, 25 Nov 2025 21:15:36 +0100 [thread overview]
Message-ID: <20251125201700.1901959-7-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20251125201700.1901959-1-andriy.shevchenko@linux.intel.com>
Use SPI_MODE_X_MASK instead of open coded variant.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/spi/spi-microchip-core-spi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/spi/spi-microchip-core-spi.c b/drivers/spi/spi-microchip-core-spi.c
index 68b136157fac..2d7ee556eafd 100644
--- a/drivers/spi/spi-microchip-core-spi.c
+++ b/drivers/spi/spi-microchip-core-spi.c
@@ -149,8 +149,6 @@ static void mchp_corespi_set_cs(struct spi_device *spi, bool disable)
static int mchp_corespi_setup(struct spi_device *spi)
{
- u32 dev_mode = spi->mode & (SPI_CPOL | SPI_CPHA);
-
if (spi_get_csgpiod(spi, 0))
return 0;
@@ -159,7 +157,7 @@ static int mchp_corespi_setup(struct spi_device *spi)
return -EOPNOTSUPP;
}
- if (dev_mode & ~spi->controller->mode_bits) {
+ if (spi->mode & SPI_MODE_X_MASK & ~spi->controller->mode_bits) {
dev_err(&spi->dev, "incompatible CPOL/CPHA, must match controller's Motorola mode\n");
return -EINVAL;
}
--
2.50.1
next prev parent reply other threads:[~2025-11-25 20:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 20:15 [PATCH v1 0/7] spi: microchip-core: Code improvements Andy Shevchenko
2025-11-25 20:15 ` [PATCH v1 1/7] spi: microchip-core: use min() instead of min_t() Andy Shevchenko
2025-11-25 20:15 ` [PATCH v1 2/7] spi: microchip-core: Make use of device properties Andy Shevchenko
2025-11-25 22:42 ` Mark Brown
2025-11-25 23:00 ` Conor Dooley
2025-11-25 23:19 ` Mark Brown
2025-11-26 6:35 ` Andy Shevchenko
2025-11-26 12:03 ` Mark Brown
2025-11-26 16:27 ` Andy Shevchenko
2025-11-26 17:24 ` Mark Brown
2025-11-26 17:29 ` Conor Dooley
2025-11-26 17:45 ` Andy Shevchenko
2025-11-25 20:15 ` [PATCH v1 3/7] spi: microchip-core: Refactor FIFO read and write handlers Andy Shevchenko
2025-11-25 20:15 ` [PATCH v1 4/7] spi: microchip-core: Replace dead code (-ENOMEM error message) Andy Shevchenko
2025-11-25 20:15 ` [PATCH v1 5/7] spi: microchip-core: Utilise temporary variable for struct device Andy Shevchenko
2025-11-25 20:15 ` Andy Shevchenko [this message]
2025-11-25 20:15 ` [PATCH v1 7/7] spi: microchip-core: Remove unneeded PM related macro Andy Shevchenko
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=20251125201700.1901959-7-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=prajna.rajendrakumar@microchip.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