spi: Fix for v6.14
A simple fix for mishandling of some clk_get_optional() return codes in the OMAP driver, the problem was reported against stable kernels on a few platforms after an earlier incomplete fix was backported. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmeT1doACgkQJNaLcl1U h9BwOQf/TD8n9gpr+Gbvntg5PwoGTcJ156AgnVd5qk61jkIrkeXTXsMNDPZpMEFI mKFgRaj/GKzkUZXc2WmVQp+xG2J+PF+u4JEW+w7vcdJpdH2dvUjm/LyiUzibVMgA Ai6ZdLaqNlcD8aGIn35pRrgmmiy7+u+YxPtmuC6P0x3pG4HFPvBawJtb0WGg867t L/Gkc2UfWAYDxZ2tBPapspt2GGdpuCb306SRyaHW5sXgMsy+PhV/K8Kg+WPzhZCQ LsxJtx+gw/1lVPoDpqwjWlk7uYL34u4KkPOyDOx2G9K6tw7UKsfNLEAiG4+2HwsR z4UiwuufYwSyHPhgU+HL1UupLYQcRQ== =M9a4 -----END PGP SIGNATURE----- Merge tag 'spi-fix-v6.14-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fix from Mark Brown: "A simple fix for mishandling of some clk_get_optional() return codes in the OMAP driver, the problem was reported against stable kernels on a few platforms after an earlier incomplete fix was backported" * tag 'spi-fix-v6.14-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: omap2-mcspi: Correctly handle devm_clk_get_optional() errors
This commit is contained in:
commit
b46c89c08f
1 changed files with 8 additions and 3 deletions
|
@ -1561,10 +1561,15 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
|
|||
}
|
||||
|
||||
mcspi->ref_clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
|
||||
if (IS_ERR(mcspi->ref_clk))
|
||||
mcspi->ref_clk_hz = OMAP2_MCSPI_MAX_FREQ;
|
||||
else
|
||||
if (IS_ERR(mcspi->ref_clk)) {
|
||||
status = PTR_ERR(mcspi->ref_clk);
|
||||
dev_err_probe(&pdev->dev, status, "Failed to get ref_clk");
|
||||
goto free_ctlr;
|
||||
}
|
||||
if (mcspi->ref_clk)
|
||||
mcspi->ref_clk_hz = clk_get_rate(mcspi->ref_clk);
|
||||
else
|
||||
mcspi->ref_clk_hz = OMAP2_MCSPI_MAX_FREQ;
|
||||
ctlr->max_speed_hz = mcspi->ref_clk_hz;
|
||||
ctlr->min_speed_hz = mcspi->ref_clk_hz >> 15;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue