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 1/3] ASoC: ti: davinci-mcasp: Use of_device_get_match_data
Date: Mon, 16 Aug 2021 21:33:16 +0300 [thread overview]
Message-ID: <b7541f9c-8e21-300d-ed3c-ea5e610b7266@gmail.com> (raw)
In-Reply-To: <ffe9b568be52cc075df56bbf07f20a92cb54f07d.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-mcasp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index 56a19eeec5c7..b26e8d324078 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -1881,7 +1881,7 @@ static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
> static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
> struct platform_device *pdev)
> {
> - const struct of_device_id *match = of_match_device(mcasp_dt_ids, &pdev->dev);
> + const struct of_device_id *match = of_device_get_match_data(&pdev->dev);
No.
of_device_get_match_data() returns the match->data
> struct device_node *np = pdev->dev.of_node;
> struct davinci_mcasp_pdata *pdata = NULL;
> const u32 *of_serial_dir32;
>
--
Péter
next prev parent 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 [this message]
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
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=b7541f9c-8e21-300d-ed3c-ea5e610b7266@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).