spi: rockchip: Fix PM runtime count on no-op cs
authorChristian Loehle <christian.loehle@arm.com>
Fri, 6 Dec 2024 19:50:55 +0000 (19:50 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 9 Dec 2024 13:06:23 +0000 (13:06 +0000)
commit0bb394067a792e7119abc9e0b7158ef19381f456
treedc1fd97377e051ff3efb7d9f8e24a790f77915bd
parentc84dda3751e945a67d71cbe3af4474aad24a5794
spi: rockchip: Fix PM runtime count on no-op cs

The early bail out that caused an out-of-bounds write was removed with
commit 5c018e378f91 ("spi: spi-rockchip: Fix out of bounds array
access")
Unfortunately that caused the PM runtime count to be unbalanced and
underflowed on the first call. To fix that reintroduce a no-op check
by reading the register directly.

Cc: stable@vger.kernel.org
Fixes: 5c018e378f91 ("spi: spi-rockchip: Fix out of bounds array access")
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Link: https://patch.msgid.link/1f2b3af4-2b7a-4ac8-ab95-c80120ebf44c@arm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-rockchip.c