From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Zhen Ni <nizhen@uniontech.com>,
broonie@kernel.org, tiwai@suse.com, perex@perex.cz
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: Intel: boards: Use temporary variable for struct device
Date: Thu, 10 Mar 2022 09:30:32 -0600 [thread overview]
Message-ID: <1371b991-ba9e-f1a8-db6a-f5cd645e7ba6@linux.intel.com> (raw)
In-Reply-To: <20220310065354.14493-1-nizhen@uniontech.com>
On 3/10/22 00:53, Zhen Ni wrote:
> Use temporary variable for struct device to make code neater. >
> Signed-off-by: Zhen Ni <nizhen@uniontech.com>
There's quite a few Intel machine drivers where we have the same sort of
code, we'll need to do a wider cleanup at some point.
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
> sound/soc/intel/boards/cht_bsw_max98090_ti.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
> index 1bc21434c9de..d9f4206e1f96 100644
> --- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
> +++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
> @@ -538,7 +538,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
> const char *platform_name;
> bool sof_parent;
>
> - drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
> + drv = devm_kzalloc(dev, sizeof(*drv), GFP_KERNEL);
> if (!drv)
> return -ENOMEM;
>
> @@ -559,8 +559,8 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
> }
>
> /* override plaform name, if required */
> - snd_soc_card_cht.dev = &pdev->dev;
> - mach = pdev->dev.platform_data;
> + snd_soc_card_cht.dev = dev;
> + mach = dev->platform_data;
> platform_name = mach->mach_params.platform;
>
> ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht,
> @@ -576,9 +576,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
> else
> mclk_name = "pmc_plt_clk_3";
>
> - drv->mclk = devm_clk_get(&pdev->dev, mclk_name);
> + drv->mclk = devm_clk_get(dev, mclk_name);
> if (IS_ERR(drv->mclk)) {
> - dev_err(&pdev->dev,
> + dev_err(dev,
> "Failed to get MCLK from %s: %ld\n",
> mclk_name, PTR_ERR(drv->mclk));
> return PTR_ERR(drv->mclk);
> @@ -594,12 +594,12 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
> if (drv->quirks & QUIRK_PMC_PLT_CLK_0) {
> ret_val = clk_prepare_enable(drv->mclk);
> if (ret_val < 0) {
> - dev_err(&pdev->dev, "MCLK enable error: %d\n", ret_val);
> + dev_err(dev, "MCLK enable error: %d\n", ret_val);
> return ret_val;
> }
> }
>
> - sof_parent = snd_soc_acpi_sof_parent(&pdev->dev);
> + sof_parent = snd_soc_acpi_sof_parent(dev);
>
> /* set card and driver name */
> if (sof_parent) {
> @@ -614,9 +614,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
> if (sof_parent)
> dev->driver->pm = &snd_soc_pm_ops;
>
> - ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
> + ret_val = devm_snd_soc_register_card(dev, &snd_soc_card_cht);
> if (ret_val) {
> - dev_err(&pdev->dev,
> + dev_err(dev,
> "snd_soc_register_card failed %d\n", ret_val);
> return ret_val;
> }
next prev parent reply other threads:[~2022-03-10 18:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 6:53 Zhen Ni
2022-03-10 15:30 ` Pierre-Louis Bossart [this message]
2022-03-11 13:42 ` Mark Brown
2022-04-07 9:38 ` Mark Brown
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=1371b991-ba9e-f1a8-db6a-f5cd645e7ba6@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nizhen@uniontech.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/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
all inboxes | Powered by JetHome®