Patch "spi: zynq-qspi: Add check for clk_enable()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    spi: zynq-qspi: Add check for clk_enable()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     spi-zynq-qspi-add-check-for-clk_enable.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 556623acfdd01a3178c30f095e5110dacf19cc64
Author: Mingwei Zheng <zmw12306@xxxxxxxxx>
Date:   Fri Dec 6 20:52:06 2024 -0500

    spi: zynq-qspi: Add check for clk_enable()
    
    [ Upstream commit 8332e667099712e05ec87ba2058af394b51ebdc9 ]
    
    Add check for the return value of clk_enable() to catch the potential
    error.
    
    Fixes: c618a90dcaf3 ("spi: zynq-qspi: Drop GPIO header")
    Signed-off-by: Mingwei Zheng <zmw12306@xxxxxxxxx>
    Signed-off-by: Jiasheng Jiang <jiashengjiangcool@xxxxxxxxx>
    Link: https://patch.msgid.link/20241207015206.3689364-1-zmw12306@xxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index 78f31b61a2aac..77ea6b5223483 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -379,12 +379,21 @@ static int zynq_qspi_setup_op(struct spi_device *spi)
 {
 	struct spi_controller *ctlr = spi->master;
 	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);
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux