Skip to content

Commit 9c3d68c

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-card: remove card check
only snd_soc_card_set_bias_level() and snd_soc_card_set_bias_level_post() are checking "card" in the function, like below int snd_soc_card_set_bias_level(...) { ... => if (card && card->xxx) ret = card->xxxx(...); ... } But it should already have been an error if "card" was NULL. remove "card" NULL check here. Otherwise it will get waring on smatch without this patch. This is prepare for error check cleanup. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 309caee commit 9c3d68c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/soc-card.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ int snd_soc_card_set_bias_level(struct snd_soc_card *card,
219219
{
220220
int ret = 0;
221221

222-
if (card && card->set_bias_level)
222+
if (card->set_bias_level)
223223
ret = card->set_bias_level(card, dapm, level);
224224

225225
return soc_card_ret(card, ret);
@@ -231,7 +231,7 @@ int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
231231
{
232232
int ret = 0;
233233

234-
if (card && card->set_bias_level_post)
234+
if (card->set_bias_level_post)
235235
ret = card->set_bias_level_post(card, dapm, level);
236236

237237
return soc_card_ret(card, ret);

0 commit comments

Comments
 (0)