linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
To: Aakash Hemadri <aakashhemadri123@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Cc: Takashi Iwai <tiwai@suse.com>, Jawoslav Kysela <perex@perex.cz>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>,
	Bjorn Helgaas <bjorn@helgaas.com>
Subject: Re: [PATCH 3/3] ASoC: ti: davinci-evm: Use of_device_get_match_data
Date: Mon, 16 Aug 2021 21:34:10 +0300	[thread overview]
Message-ID: <b096a803-093a-b70f-2999-38bfe8978513@gmail.com> (raw)
In-Reply-To: <6ebb350fa8a960b8775ce324b7786dbaa865a1c8.1628972198.git.aakashhemadri123@gmail.com>



On 14/08/2021 23:19, Aakash Hemadri wrote:
> Prefer `of_device_get_match_data` over `of_match_device`
> 
> Retrieve OF match data using `of_device_get_match_data`, this is cleaner
> and better expresses intent.
> 
> Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
> ---
>  sound/soc/ti/davinci-evm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/ti/davinci-evm.c b/sound/soc/ti/davinci-evm.c
> index b043a0070d20..bf13f3d25cec 100644
> --- a/sound/soc/ti/davinci-evm.c
> +++ b/sound/soc/ti/davinci-evm.c
> @@ -389,7 +389,7 @@ static int davinci_evm_probe(struct platform_device *pdev)
>  	struct clk *mclk;
>  	int ret = 0;
>  
> -	match = of_match_device(of_match_ptr(davinci_evm_dt_ids), &pdev->dev);
> +	match = of_device_get_match_data(&pdev->dev);

incorrect,
of_device_get_match_data() is retrieving the match->data

>  	if (!match) {
>  		dev_err(&pdev->dev, "Error: No device match found\n");
>  		return -ENODEV;
> 

-- 
Péter

  reply	other threads:[~2021-08-16 18:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14 20:19 [PATCH 0/3] ASoC: ti: Use of_device_get_match_data Aakash Hemadri
2021-08-14 20:19 ` [PATCH 1/3] ASoC: ti: davinci-mcasp: " Aakash Hemadri
2021-08-16 18:33   ` Péter Ujfalusi
2021-08-14 20:19 ` [PATCH 2/3] ASoC: ti: omap-mcbsp: " Aakash Hemadri
2021-08-16 18:35   ` Péter Ujfalusi
2021-08-14 20:19 ` [PATCH 3/3] ASoC: ti: davinci-evm: " Aakash Hemadri
2021-08-16 18:34   ` Péter Ujfalusi [this message]
2021-08-16 18:37 ` [PATCH 0/3] ASoC: ti: " Péter Ujfalusi

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=b096a803-093a-b70f-2999-38bfe8978513@gmail.com \
    --to=peter.ujfalusi@gmail.com \
    --cc=aakashhemadri123@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bjorn@helgaas.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=skhan@linuxfoundation.org \
    --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;
as well as URLs for NNTP newsgroup(s).