From: Matthias Brugger <matthias.bgg@gmail.com>
To: Liu Jing <liujing@cmss.chinamobile.com>, lgirdwood@gmail.com
Cc: broonie@kernel.org, perex@perex.cz,
angelogioacchino.delregno@collabora.com,
linus.walleij@linaro.org, bartosz.golaszewski@linaro.org,
kuninori.morimoto.gx@renesas.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] ASoC: mediatek: mt2701-cs42448: Optimize redundant code in mt2701_cs42448_machine_probe
Date: Wed, 4 Sep 2024 10:47:00 +0200 [thread overview]
Message-ID: <25f8a244-45c4-44bb-a0c1-37c057dd8d7b@gmail.com> (raw)
In-Reply-To: <20240903093623.7120-1-liujing@cmss.chinamobile.com>
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;
> }
next prev parent reply other threads:[~2024-09-04 9:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2024-09-04 15:55 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2024-07-02 4:36 Liu Jing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25f8a244-45c4-44bb-a0c1-37c057dd8d7b@gmail.com \
--to=matthias.bgg@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=liujing@cmss.chinamobile.com \
--cc=perex@perex.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox