Commit eea0e7d2 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: stm32-qspi: Replace of_gpio_named_count() by gpiod_count()

As a preparation to unexport of_gpio_named_count(), convert the
driver to use gpiod_count() instead.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarPatrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20220830182821.47919-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fb43eb0a
......@@ -656,7 +656,7 @@ static int stm32_qspi_setup(struct spi_device *spi)
mode = spi->mode & (SPI_TX_OCTAL | SPI_RX_OCTAL);
if ((mode == SPI_TX_OCTAL || mode == SPI_RX_OCTAL) ||
((mode == (SPI_TX_OCTAL | SPI_RX_OCTAL)) &&
of_gpio_named_count(qspi->dev->of_node, "cs-gpios") == -ENOENT)) {
gpiod_count(qspi->dev, "cs") == -ENOENT)) {
dev_err(qspi->dev, "spi-rx-bus-width\\/spi-tx-bus-width\\/cs-gpios\n");
dev_err(qspi->dev, "configuration not supported\n");
......@@ -681,7 +681,7 @@ static int stm32_qspi_setup(struct spi_device *spi)
* are both set in spi->mode and "cs-gpios" properties is found in DT
*/
if (((spi->mode & (SPI_TX_OCTAL | SPI_RX_OCTAL)) == (SPI_TX_OCTAL | SPI_RX_OCTAL)) &&
of_gpio_named_count(qspi->dev->of_node, "cs-gpios")) {
gpiod_count(qspi->dev, "cs")) {
qspi->cr_reg |= CR_DFM;
dev_dbg(qspi->dev, "Dual flash mode enable");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment