ASoC: mediatek: mt8183: move card registration to the end of probe
Subsystems (3)
PATCH 1/1 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.
--- .../soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +2 -7
@@ -345,7 +345,7 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)struct device_node *platform_node;struct snd_soc_dai_link *dai_link;struct pinctrl *default_pins; -int ret, i; +int i; card->dev = &pdev->dev;
@@ -380,11 +380,6 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)return -EINVAL ; } - ret =devm_snd_soc_register_card (&pdev->dev, card); -if (ret) -dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , - __func__, ret); - default_pins =devm_pinctrl_get_select (&pdev->dev,PINCTRL_STATE_DEFAULT );if (IS_ERR (default_pins)) {
@@ -393,7 +388,7 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)return PTR_ERR (default_pins); } -return ret; +return devm_snd_soc_register_card (&pdev->dev, card); }#ifdef CONFIG_OF
Signature · 1 line
2.21.0.1020.gf2820cf01a-goog
Mark Brown
maintainerApplied "ASoC: mediatek: mt8183: move card registration to the end of probe" to the asoc tree
The patch
ASoC: mediatek: mt8183: move card registration to the end of probe
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.3
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
63ba8e4d04ab921f8aaa89227d2e0f7ad79725beMon Sep 17 00:00:00 2001
From: Tzung-Bi Shih <[email protected]>
Date: Wed, 22 May 2019 22:54:02 +0800
Subject: [PATCH] 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.
--- .../soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +2 -7
@@ -331,7 +331,7 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)struct device_node *platform_node;struct snd_soc_dai_link *dai_link;struct pinctrl *default_pins; -int ret, i; +int i; card->dev = &pdev->dev;
@@ -366,11 +366,6 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)return -EINVAL ; } - ret =devm_snd_soc_register_card (&pdev->dev, card); -if (ret) -dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , - __func__, ret); - default_pins =devm_pinctrl_get_select (&pdev->dev,PINCTRL_STATE_DEFAULT );if (IS_ERR (default_pins)) {
@@ -379,7 +374,7 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)return PTR_ERR (default_pins); } -return ret; +return devm_snd_soc_register_card (&pdev->dev, card); }#ifdef CONFIG_OF
Signature · 1 line
2.20.1