Patch "spi: omap2-mcspi: Fix the IS_ERR() bug for devm_clk_get_optional_enabled()" has been added to the 6.6-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: omap2-mcspi: Fix the IS_ERR() bug for devm_clk_get_optional_enabled()

to the 6.6-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-omap2-mcspi-fix-the-is_err-bug-for-devm_clk_get_.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 246fd29c8a48ebf4ca9389d032e076aca9bf20a6
Author: Purushothama Siddaiah <psiddaiah@xxxxxxxxxx>
Date:   Thu Dec 5 12:34:26 2024 +0530

    spi: omap2-mcspi: Fix the IS_ERR() bug for devm_clk_get_optional_enabled()
    
    [ Upstream commit 4c6ac5446d060f0bf435ccc8bc3aa7b7b5f718ad ]
    
    The devm_clk_get_optional_enabled() function returns error
    pointers(PTR_ERR()). So use IS_ERR() to check it.
    
    Verified on K3-J7200 EVM board, without clock node mentioned
    in the device tree.
    
    Signed-off-by: Purushothama Siddaiah <psiddaiah@xxxxxxxxxx>
    Reviewed-by: Corey Minyard <cminyard@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241205070426.1861048-1-psiddaiah@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index ddf1c684bcc7..3cfd262c1abc 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1521,10 +1521,10 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 	}
 
 	mcspi->ref_clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
-	if (mcspi->ref_clk)
-		mcspi->ref_clk_hz = clk_get_rate(mcspi->ref_clk);
-	else
+	if (IS_ERR(mcspi->ref_clk))
 		mcspi->ref_clk_hz = OMAP2_MCSPI_MAX_FREQ;
+	else
+		mcspi->ref_clk_hz = clk_get_rate(mcspi->ref_clk);
 	ctlr->max_speed_hz = mcspi->ref_clk_hz;
 	ctlr->min_speed_hz = mcspi->ref_clk_hz >> 15;
 




[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