mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 08:35:19 -05:00
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: 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>
This commit is contained in:
parent
61cabbd5ef
commit
ef901b38d3
1 changed files with 9 additions and 2 deletions
|
@ -756,8 +756,15 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev)
|
||||||
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
|
struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
clk_prepare(aq->pclk);
|
ret = clk_prepare(aq->pclk);
|
||||||
clk_prepare(aq->qspick);
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ret = clk_prepare(aq->qspick);
|
||||||
|
if (ret) {
|
||||||
|
clk_unprepare(aq->pclk);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ret = pm_runtime_force_resume(dev);
|
ret = pm_runtime_force_resume(dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue