spi: intel: Check number of chip selects after reading the descriptor
authorMika Westerberg <mika.westerberg@linux.intel.com>
Wed, 15 Feb 2023 11:00:40 +0000 (13:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:20 +0000 (08:50 +0100)
commit87228e1c18dc42db5c63b3d772a63adb9b49b47c
tree70c2322b4e7ebb41193656cb281a8a569101251f
parent9858e0fb32b691b0c472d334a7b39081be09ccad
spi: intel: Check number of chip selects after reading the descriptor

[ Upstream commit 574fbb95cd9d88bdc9c9c4c64223a38a61d7de9a ]

The flash decriptor contains the number of flash components that we use
to figure out how many flash chips there are connected. Therefore we
need to read it first before deciding how many chip selects the
controller has.

Reported-by: Marcin Witkowski <marcin.witkowski@intel.com>
Fixes: 3f03c618bebb ("spi: intel: Add support for second flash chip")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20230215110040.42186-1-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-intel.c