]> git.baikalelectronics.ru Git - kernel.git/commit
spi: stm32-qspi: Refactor dual flash mode enable check in ->setup()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 30 Aug 2022 18:28:21 +0000 (21:28 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 31 Aug 2022 11:13:11 +0000 (12:13 +0100)
commita0b4fb2d25273fb91675796abfe85dcee5444524
treead5af8a3189b362a83c19b50e07a9dc17584b901
parent6963731088e550f237866778e59d9a4c7ed60fc9
spi: stm32-qspi: Refactor dual flash mode enable check in ->setup()

gpiod_count() either returns positive number of the CS or negative
error code. In the stm32_qspi_setup() we check that configuration
has enough CS for the dual flash mode and SPI mode is not changing
over the lines of the code. Taking all above into considertion,
refactor dual flash mode enable check by dropping unneeded CS check
and reusing local mode variable.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20220830182821.47919-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32-qspi.c