From: Dan Carpenter Date: Wed, 26 Nov 2025 14:52:26 +0000 (+0300) Subject: ASoC: mediatek: mt8189: remove unnecessary NULL check X-Git-Tag: v6.19-rc1~156^2~3^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d3fcd0ebe91c2079b4aeaffc7493a0bb2ad45f2;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://patch.msgid.link/aScUKqCEhSIZoOmg@stanley.mountain Signed-off-by: Mark Brown --- diff --git a/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c b/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c index dcee8e11eca86..166ece74270ec 100644 --- a/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c +++ b/sound/soc/mediatek/mt8189/mt8189-afe-pcm.c @@ -2352,12 +2352,10 @@ static int mt8189_afe_component_probe(struct snd_soc_component *component) { struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); - if (component) { - /* enable clock for regcache get default value from hw */ - pm_runtime_get_sync(afe->dev); - mtk_afe_add_sub_dai_control(component); - pm_runtime_put_sync(afe->dev); - } + /* enable clock for regcache get default value from hw */ + pm_runtime_get_sync(afe->dev); + mtk_afe_add_sub_dai_control(component); + pm_runtime_put_sync(afe->dev); return 0; }