spi: atmel-quadspi: Add missing check for clk_prepare

BugLink: https://bugs.launchpad.net/bugs/2083196

[ Upstream commit ef901b38d3a4610c4067cd306c1a209f32e7ca31 ]

Add check for the return value of clk_prepare() and return the error if
it fails in order to catch the error.

Fixes: 4a2f83b7f7 ("spi: atmel-quadspi: add runtime pm support")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://msgid.link/r/20240515084028.3210406-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
Chen Ni
2024-05-15 16:40:28 +08:00
committed by Mehmet Basaran
parent 64143b70c0
commit 0e303b764a
+9 -2
View File
@@ -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)