Skip to content

Commit 9d3fcd0

Browse files
Dan Carpenterbroonie
authored andcommitted
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>
1 parent 900baa6 commit 9d3fcd0

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

sound/soc/mediatek/mt8189/mt8189-afe-pcm.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,12 +2352,10 @@ static int mt8189_afe_component_probe(struct snd_soc_component *component)
23522352
{
23532353
struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component);
23542354

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);
23612359

23622360
return 0;
23632361
}

0 commit comments

Comments
 (0)