Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: mediatek: mt8189: remove unnecessary NULL check

Smatch complains that the call to snd_soc_component_get_drvdata(component)
will dereference "component" so this NULL check is too late. The probe()
function will never be called with a NULL component pointer so just
delete the check.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aScUKqCEhSIZoOmg@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dan Carpenter and committed by
Mark Brown
9d3fcd0e 900baa6e

+4 -6
+4 -6
sound/soc/mediatek/mt8189/mt8189-afe-pcm.c
··· 2352 2352 { 2353 2353 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); 2354 2354 2355 - if (component) { 2356 - /* enable clock for regcache get default value from hw */ 2357 - pm_runtime_get_sync(afe->dev); 2358 - mtk_afe_add_sub_dai_control(component); 2359 - pm_runtime_put_sync(afe->dev); 2360 - } 2355 + /* enable clock for regcache get default value from hw */ 2356 + pm_runtime_get_sync(afe->dev); 2357 + mtk_afe_add_sub_dai_control(component); 2358 + pm_runtime_put_sync(afe->dev); 2361 2359 2362 2360 return 0; 2363 2361 }