spi: atmel-quadspi: Don't leak clk enable count in pm resume
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 17 Mar 2023 08:42:30 +0000 (09:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:27 +0000 (23:03 +0900)
commitd748e32026aa715b0d5494cb7cda34d2ff9aa470
tree54c7533b6d3bdac0ee0062affa510022ce7fc487
parent3eb8bebd02f015b41a76e3b5b3da7c027b2d9915
spi: atmel-quadspi: Don't leak clk enable count in pm resume

[ Upstream commit c18bbac353ffed50be134b0a2a059a2bd540c503 ]

The pm resume call is supposed to enable two clocks. If the second enable
fails the callback reports failure but doesn't undo the first enable.

So call clk_disable() for the first clock when clk_enable() for the second
one fails.

Fixes: 4a2f83b7f780 ("spi: atmel-quadspi: add runtime pm support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Link: https://lore.kernel.org/r/20230317084232.142257-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/atmel-quadspi.c