Skip to content
Verified Commit a07eb4f6 authored by Mark Brown's avatar Mark Brown
Browse files

spi: omap2-mcspi: Correctly handle devm_clk_get_optional() errors



devm_clk_get_optional() returns NULL for missing clocks and a PTR_ERR()
if there is a clock but we fail to get it, but currently we only handle
the latter case and do so as though the clock was missing.  If we get an
error back we should handle that as an error since the clock exists but
we failed to get it, if we get NULL then the clock doesn't exist and we
should handle that.

Fixes: 4c6ac544 ("spi: omap2-mcspi: Fix the IS_ERR() bug for devm_clk_get_optional_enabled()")
Reported-by: default avatarLars Pedersen <lapeddk@gmail.com>
Link: https://patch.msgid.link/20250117-spi-fix-omap2-optional-v1-1-e77d4ac6db6e@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Tested-by: default avatarLars Pedersen <lapeddk@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 78b435c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment