Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@kernel.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-sound@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>,
	 Mark Brown <broonie@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	 Jonathan Hunter <jonathanh@nvidia.com>,
	 "open list:TEGRA ARCHITECTURE SUPPORT"
	<linux-tegra@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: tegra: ADX: use of_device_get_match_data
Date: Thu, 28 May 2026 22:35:49 +0200	[thread overview]
Message-ID: <ahimtheMu3fjdTf6@orome> (raw)
In-Reply-To: <20260522015856.741656-1-rosenp@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

On Thu, May 21, 2026 at 06:58:56PM -0700, Rosen Penev wrote:
> Remove open coding of the function to simplify the code.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  sound/soc/tegra/tegra210_adx.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/tegra/tegra210_adx.c b/sound/soc/tegra/tegra210_adx.c
> index 12371f895234..a2c28369fbc8 100644
> --- a/sound/soc/tegra/tegra210_adx.c
> +++ b/sound/soc/tegra/tegra210_adx.c
> @@ -677,17 +677,16 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct tegra210_adx *adx;
> -	const struct of_device_id *match;
> -	struct tegra210_adx_soc_data *soc_data;
> +	const struct tegra210_adx_soc_data *soc_data;
>  	void __iomem *regs;
>  	int err, i;
>  
> +	soc_data = of_device_get_match_data(dev);
> +
>  	adx = devm_kzalloc(dev, sizeof(*adx), GFP_KERNEL);
>  	if (!adx)
>  		return -ENOMEM;
>  
> -	match = of_match_device(tegra210_adx_of_match, dev);
> -	soc_data = (struct tegra210_adx_soc_data *)match->data;
>  	adx->soc_data = soc_data;

Why not just:

	adx->soc_data = of_device_get_match_data(dev);

? That saves you a few temporary variables and since you're not moving
around the assignment needlessly, you get a much simpler diff, too.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-05-28 20:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22  1:58 [PATCH] ASoC: tegra: ADX: use of_device_get_match_data Rosen Penev
2026-05-28 20:35 ` Thierry Reding [this message]
2026-05-28 20:41   ` Rosen Penev
2026-05-28 21:00     ` Thierry Reding

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=ahimtheMu3fjdTf6@orome \
    --to=thierry.reding@kernel.org \
    --cc=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=rosenp@gmail.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