]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: cadence-quadspi: Fix cqspi_setup_flash()
authorSanthosh Kumar K <s-k6@ti.com>
Fri, 5 Sep 2025 18:59:57 +0000 (00:29 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 9 Sep 2025 13:17:34 +0000 (14:17 +0100)
commit858d4d9e0a9d6b64160ef3c824f428c9742172c4
tree18f0bf66cdc2b7ab27c53e3c3ae5e92761a98cbc
parent1ad55767e77a853c98752ed1e33b68049a243bd7
spi: cadence-quadspi: Fix cqspi_setup_flash()

The 'max_cs' stores the largest chip select number. It should only
be updated when the current 'cs' is greater than existing 'max_cs'. So,
fix the condition accordingly.

Also, return failure if there are no flash device declared.

Fixes: 0f3841a5e115 ("spi: cadence-qspi: report correct number of chip-select")
CC: stable@vger.kernel.org
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com>
Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Message-ID: <20250905185958.3575037-4-s-k6@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c