Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: Sachin Mokashi <sachin.mokashi@intel.com>
Cc: <linux-sound@vger.kernel.org>, <alsa-devel@alsa-project.org>,
	<tiwai@suse.com>, <pierre-louis.bossart@linux.dev>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] ASoC: Intel: cht_bsw_rt5672: Simplify probe() with local 'dev' pointer
Date: Mon, 27 Apr 2026 17:19:51 +0200	[thread overview]
Message-ID: <4d5f3abb-bab9-468e-b1be-74bfa728b255@intel.com> (raw)
In-Reply-To: <20260427144619.1739971-1-sachin.mokashi@intel.com>

On 2026-04-27 4:46 PM, Sachin Mokashi wrote:
> In snd_cht_mc_probe(), &pdev->dev is dereferenced repeatedly throughout
> the function. Introduce a local dev pointer
> early in the function and use it consistently in place of all open-coded
> &pdev->dev references.
> 
> It reduces repetition, improves readability, and aligns with the common
> kernel driver pattern of caching the device pointer at function entry.

One nit below but it's not a strong for v2.  For the patch:

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>


> @@ -450,12 +450,13 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
>   	struct cht_mc_private *drv;
>   	struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
>   	const char *platform_name;
> +	struct device *dev = &pdev->dev;

Weird location for this declaration. Why in the middle of nowhere?

>   	struct acpi_device *adev;
>   	bool sof_parent;
>   	int dai_index = 0;
>   	int i;

  reply	other threads:[~2026-04-27 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 14:46 [PATCH] ASoC: Intel: cht_bsw_rt5672: Simplify probe() with local 'dev' pointer Sachin Mokashi
2026-04-27 15:19 ` Cezary Rojewski [this message]
2026-04-28 12:54   ` Mokashi, Sachin
2026-04-27 22:44 ` 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=4d5f3abb-bab9-468e-b1be-74bfa728b255@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=sachin.mokashi@intel.com \
    --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