* [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe
@ 2024-07-02 4:36 Liu Jing
0 siblings, 0 replies; 4+ messages in thread
From: Liu Jing @ 2024-07-02 4:36 UTC (permalink / raw)
To: lgirdwood, broonie, perex, tiwai, matthias.bgg,
angelogioacchino.delregno, kuninori.morimoto.gx,
bartosz.golaszewski, linus.walleij
Cc: linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek,
liujing
Utilize the defined parameter 'dev' to make the code cleaner.
Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
---
sound/soc/mediatek/mt2701/mt2701-cs42448.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/soc/mediatek/mt2701/mt2701-cs42448.c b/sound/soc/mediatek/mt2701/mt2701-cs42448.c
index 1262e8a1bc9a..4974b0536b7b 100644
--- a/sound/soc/mediatek/mt2701/mt2701-cs42448.c
+++ b/sound/soc/mediatek/mt2701/mt2701-cs42448.c
@@ -329,10 +329,10 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
int ret;
int i;
struct device_node *platform_node, *codec_node, *codec_node_bt_mrg;
+ struct device *dev = &pdev->dev;
struct mt2701_cs42448_private *priv =
- devm_kzalloc(&pdev->dev, sizeof(struct mt2701_cs42448_private),
+ devm_kzalloc(dev, sizeof(struct mt2701_cs42448_private),
GFP_KERNEL);
- struct device *dev = &pdev->dev;
struct snd_soc_dai_link *dai_link;
if (!priv)
@@ -341,7 +341,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
platform_node = of_parse_phandle(pdev->dev.of_node,
"mediatek,platform", 0);
if (!platform_node) {
- dev_err(&pdev->dev, "Property 'platform' missing or invalid\n");
+ dev_err(dev, "Property 'platform' missing or invalid\n");
return -EINVAL;
}
for_each_card_prelinks(card, i, dai_link) {
@@ -355,7 +355,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
codec_node = of_parse_phandle(pdev->dev.of_node,
"mediatek,audio-codec", 0);
if (!codec_node) {
- dev_err(&pdev->dev,
+ dev_err(dev,
"Property 'audio-codec' missing or invalid\n");
return -EINVAL;
}
@@ -368,7 +368,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
codec_node_bt_mrg = of_parse_phandle(pdev->dev.of_node,
"mediatek,audio-codec-bt-mrg", 0);
if (!codec_node_bt_mrg) {
- dev_err(&pdev->dev,
+ dev_err(dev,
"Property 'audio-codec-bt-mrg' missing or invalid\n");
return -EINVAL;
}
@@ -377,7 +377,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
if (ret) {
- dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
+ dev_err(dev, "failed to parse audio-routing: %d\n", ret);
return ret;
}
@@ -395,10 +395,10 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, priv);
- ret = devm_snd_soc_register_card(&pdev->dev, card);
+ ret = devm_snd_soc_register_card(dev, card);
if (ret)
- dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
+ dev_err(dev, "%s snd_soc_register_card fail %d\n",
__func__, ret);
return ret;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe
@ 2024-09-03 9:36 Liu Jing
2024-09-04 8:47 ` Matthias Brugger
2024-09-04 15:55 ` Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Liu Jing @ 2024-09-03 9:36 UTC (permalink / raw)
To: lgirdwood
Cc: broonie, perex, matthias.bgg, angelogioacchino.delregno,
linus.walleij, bartosz.golaszewski, kuninori.morimoto.gx,
linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek,
Liu Jing
Utilize the defined parameter 'dev' to make the code cleaner.
Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
---
sound/soc/mediatek/mt2701/mt2701-cs42448.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/soc/mediatek/mt2701/mt2701-cs42448.c b/sound/soc/mediatek/mt2701/mt2701-cs42448.c
index 1262e8a1bc9a..4974b0536b7b 100644
--- a/sound/soc/mediatek/mt2701/mt2701-cs42448.c
+++ b/sound/soc/mediatek/mt2701/mt2701-cs42448.c
@@ -329,10 +329,10 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
int ret;
int i;
struct device_node *platform_node, *codec_node, *codec_node_bt_mrg;
+ struct device *dev = &pdev->dev;
struct mt2701_cs42448_private *priv =
- devm_kzalloc(&pdev->dev, sizeof(struct mt2701_cs42448_private),
+ devm_kzalloc(dev, sizeof(struct mt2701_cs42448_private),
GFP_KERNEL);
- struct device *dev = &pdev->dev;
struct snd_soc_dai_link *dai_link;
if (!priv)
@@ -341,7 +341,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
platform_node = of_parse_phandle(pdev->dev.of_node,
"mediatek,platform", 0);
if (!platform_node) {
- dev_err(&pdev->dev, "Property 'platform' missing or invalid\n");
+ dev_err(dev, "Property 'platform' missing or invalid\n");
return -EINVAL;
}
for_each_card_prelinks(card, i, dai_link) {
@@ -355,7 +355,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
codec_node = of_parse_phandle(pdev->dev.of_node,
"mediatek,audio-codec", 0);
if (!codec_node) {
- dev_err(&pdev->dev,
+ dev_err(dev,
"Property 'audio-codec' missing or invalid\n");
return -EINVAL;
}
@@ -368,7 +368,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
codec_node_bt_mrg = of_parse_phandle(pdev->dev.of_node,
"mediatek,audio-codec-bt-mrg", 0);
if (!codec_node_bt_mrg) {
- dev_err(&pdev->dev,
+ dev_err(dev,
"Property 'audio-codec-bt-mrg' missing or invalid\n");
return -EINVAL;
}
@@ -377,7 +377,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
if (ret) {
- dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
+ dev_err(dev, "failed to parse audio-routing: %d\n", ret);
return ret;
}
@@ -395,10 +395,10 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
snd_soc_card_set_drvdata(card, priv);
- ret = devm_snd_soc_register_card(&pdev->dev, card);
+ ret = devm_snd_soc_register_card(dev, card);
if (ret)
- dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
+ dev_err(dev, "%s snd_soc_register_card fail %d\n",
__func__, ret);
return ret;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe
2024-09-03 9:36 [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe Liu Jing
@ 2024-09-04 8:47 ` Matthias Brugger
2024-09-04 15:55 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Matthias Brugger @ 2024-09-04 8:47 UTC (permalink / raw)
To: Liu Jing, lgirdwood
Cc: broonie, perex, angelogioacchino.delregno, linus.walleij,
bartosz.golaszewski, kuninori.morimoto.gx, linux-sound,
linux-kernel, linux-arm-kernel, linux-mediatek
On 03/09/2024 11:36, Liu Jing wrote:
> Utilize the defined parameter 'dev' to make the code cleaner.
>
> Signed-off-by: Liu Jing <liujing@cmss.chinamobile.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> sound/soc/mediatek/mt2701/mt2701-cs42448.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/sound/soc/mediatek/mt2701/mt2701-cs42448.c b/sound/soc/mediatek/mt2701/mt2701-cs42448.c
> index 1262e8a1bc9a..4974b0536b7b 100644
> --- a/sound/soc/mediatek/mt2701/mt2701-cs42448.c
> +++ b/sound/soc/mediatek/mt2701/mt2701-cs42448.c
> @@ -329,10 +329,10 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
> int ret;
> int i;
> struct device_node *platform_node, *codec_node, *codec_node_bt_mrg;
> + struct device *dev = &pdev->dev;
> struct mt2701_cs42448_private *priv =
> - devm_kzalloc(&pdev->dev, sizeof(struct mt2701_cs42448_private),
> + devm_kzalloc(dev, sizeof(struct mt2701_cs42448_private),
> GFP_KERNEL);
> - struct device *dev = &pdev->dev;
> struct snd_soc_dai_link *dai_link;
>
> if (!priv)
> @@ -341,7 +341,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
> platform_node = of_parse_phandle(pdev->dev.of_node,
> "mediatek,platform", 0);
> if (!platform_node) {
> - dev_err(&pdev->dev, "Property 'platform' missing or invalid\n");
> + dev_err(dev, "Property 'platform' missing or invalid\n");
> return -EINVAL;
> }
> for_each_card_prelinks(card, i, dai_link) {
> @@ -355,7 +355,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
> codec_node = of_parse_phandle(pdev->dev.of_node,
> "mediatek,audio-codec", 0);
> if (!codec_node) {
> - dev_err(&pdev->dev,
> + dev_err(dev,
> "Property 'audio-codec' missing or invalid\n");
> return -EINVAL;
> }
> @@ -368,7 +368,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
> codec_node_bt_mrg = of_parse_phandle(pdev->dev.of_node,
> "mediatek,audio-codec-bt-mrg", 0);
> if (!codec_node_bt_mrg) {
> - dev_err(&pdev->dev,
> + dev_err(dev,
> "Property 'audio-codec-bt-mrg' missing or invalid\n");
> return -EINVAL;
> }
> @@ -377,7 +377,7 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
>
> ret = snd_soc_of_parse_audio_routing(card, "audio-routing");
> if (ret) {
> - dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
> + dev_err(dev, "failed to parse audio-routing: %d\n", ret);
> return ret;
> }
>
> @@ -395,10 +395,10 @@ static int mt2701_cs42448_machine_probe(struct platform_device *pdev)
>
> snd_soc_card_set_drvdata(card, priv);
>
> - ret = devm_snd_soc_register_card(&pdev->dev, card);
> + ret = devm_snd_soc_register_card(dev, card);
>
> if (ret)
> - dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
> + dev_err(dev, "%s snd_soc_register_card fail %d\n",
> __func__, ret);
> return ret;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe
2024-09-03 9:36 [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe Liu Jing
2024-09-04 8:47 ` Matthias Brugger
@ 2024-09-04 15:55 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2024-09-04 15:55 UTC (permalink / raw)
To: lgirdwood, Liu Jing
Cc: perex, matthias.bgg, angelogioacchino.delregno, linus.walleij,
bartosz.golaszewski, kuninori.morimoto.gx, linux-sound,
linux-kernel, linux-arm-kernel, linux-mediatek
On Tue, 03 Sep 2024 17:36:23 +0800, Liu Jing wrote:
> Utilize the defined parameter 'dev' to make the code cleaner.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe
commit: 77e6a5e40aa393492cf3f1d2623d7d1dff7f33de
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-04 16:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-03 9:36 [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe Liu Jing
2024-09-04 8:47 ` Matthias Brugger
2024-09-04 15:55 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2024-07-02 4:36 Liu Jing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox