aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Ni <[email protected]>2024-05-15 08:40:28 +0000
committerMark Brown <[email protected]>2024-05-27 00:33:39 +0000
commitef901b38d3a4610c4067cd306c1a209f32e7ca31 (patch)
tree111eaf4ade26b38c7018b6b724e9305534e25251
parentspi: imx: remove empty cleanup function (diff)
downloadkernel-ef901b38d3a4610c4067cd306c1a209f32e7ca31.tar.gz
kernel-ef901b38d3a4610c4067cd306c1a209f32e7ca31.zip
spi: atmel-quadspi: Add missing check for clk_prepare
Add check for the return value of clk_prepare() and return the error if it fails in order to catch the error. Fixes: 4a2f83b7f780 ("spi: atmel-quadspi: add runtime pm support") Signed-off-by: Chen Ni <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--drivers/spi/atmel-quadspi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index 370c4d1572ed..5aaff3bee1b7 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -756,8 +756,15 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev)
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
int ret;
- clk_prepare(aq->pclk);
- clk_prepare(aq->qspick);
+ ret = clk_prepare(aq->pclk);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare(aq->qspick);
+ if (ret) {
+ clk_unprepare(aq->pclk);
+ return ret;
+ }
ret = pm_runtime_force_resume(dev);
if (ret < 0)