spi: zynq-qspi: Add check for clk_enable()
BugLink: https://bugs.launchpad.net/bugs/2111953
[ Upstream commit 8332e667099712e05ec87ba2058af394b51ebdc9 ]
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: c618a90dca ("spi: zynq-qspi: Drop GPIO header")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Link: https://patch.msgid.link/20241207015206.3689364-1-zmw12306@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
b55455e13a
commit
e1dd6b1fe9
@@ -379,12 +379,21 @@ static int zynq_qspi_setup_op(struct spi_device *spi)
|
||||
{
|
||||
struct spi_controller *ctlr = spi->controller;
|
||||
struct zynq_qspi *qspi = spi_controller_get_devdata(ctlr);
|
||||
int ret;
|
||||
|
||||
if (ctlr->busy)
|
||||
return -EBUSY;
|
||||
|
||||
clk_enable(qspi->refclk);
|
||||
clk_enable(qspi->pclk);
|
||||
ret = clk_enable(qspi->refclk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = clk_enable(qspi->pclk);
|
||||
if (ret) {
|
||||
clk_disable(qspi->refclk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
zynq_qspi_write(qspi, ZYNQ_QSPI_ENABLE_OFFSET,
|
||||
ZYNQ_QSPI_ENABLE_ENABLE_MASK);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user