]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: omap2-mcspi: Correctly handle devm_clk_get_optional() errors
authorMark Brown <broonie@kernel.org>
Fri, 17 Jan 2025 16:16:03 +0000 (16:16 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 21 Jan 2025 13:07:03 +0000 (13:07 +0000)
commita07eb4f67ed085f32002a1af2b6073546d67de3f
tree1f93bbb28f6fdead6aaa5e67c599c5e1b5fac020
parent78b435c9044a9ec321da29d299c70cb14b059682
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: 4c6ac5446d06 ("spi: omap2-mcspi: Fix the IS_ERR() bug for devm_clk_get_optional_enabled()")
Reported-by: Lars Pedersen <lapeddk@gmail.com>
Link: https://patch.msgid.link/20250117-spi-fix-omap2-optional-v1-1-e77d4ac6db6e@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Tested-by: Lars Pedersen <lapeddk@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-omap2-mcspi.c