]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: mediatek: mt8183: move card registration to the end of probe
authorTzung-Bi Shih <tzungbi@google.com>
Wed, 22 May 2019 14:54:02 +0000 (22:54 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 23 May 2019 13:34:43 +0000 (14:34 +0100)
commit0829fed23e173cfdec15a79093612d5e86826ada
treefa9bc1423c79f03b9bdd54a8823c16674bd37546
parent796b4b24f7270d892da373b734ac489cefea99d2
ASoC: mediatek: mt8183: move card registration to the end of probe

mt8183_mt6358_ts3a227_max98357_dev_probe() does not return immediately
if devm_snd_soc_register_card() returns fail.  As a result, the rest of
code still get executed.

Two options to fix:
1. add an extra return statement if devm_snd_soc_register_card()
   returns fail
2. move devm_snd_soc_register_card() to the end of probe

Adopt option 2 which is more clear and common.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c