* [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-14 20:12 ` Aakash Hemadri
0 siblings, 0 replies; 24+ messages in thread
From: Aakash Hemadri @ 2021-08-14 20:12 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood
Cc: alsa-devel, linux-kernel, Takashi Iwai, Jonathan Hunter,
Bjorn Helgaas, Thierry Reding, Philipp Zabel, Shuah Khan,
linux-tegra
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/tegra/tegra30_ahub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
index b3e1df693381..0ac109b32329 100644
--- a/sound/soc/tegra/tegra30_ahub.c
+++ b/sound/soc/tegra/tegra30_ahub.c
@@ -518,7 +518,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
void __iomem *regs_apbif, *regs_ahub;
int ret = 0;
- match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
+ match = of_device_get_match_data(&pdev->dev);
if (!match)
return -EINVAL;
soc_data = match->data;
--
2.32.0
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
2021-08-14 20:12 ` Aakash Hemadri
@ 2021-08-16 9:54 ` Thierry Reding
-1 siblings, 0 replies; 24+ messages in thread
From: Thierry Reding @ 2021-08-16 9:54 UTC (permalink / raw)
To: Aakash Hemadri
Cc: Mark Brown, Liam Girdwood, Takashi Iwai, Jawoslav Kysela,
Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
linux-kernel, Shuah Khan, Bjorn Helgaas
[-- Attachment #1: Type: text/plain, Size: 451 bytes --]
On Sun, Aug 15, 2021 at 01:42:18AM +0530, 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/tegra/tegra30_ahub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-16 9:54 ` Thierry Reding
0 siblings, 0 replies; 24+ messages in thread
From: Thierry Reding @ 2021-08-16 9:54 UTC (permalink / raw)
To: Aakash Hemadri
Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
Bjorn Helgaas, Mark Brown, Philipp Zabel, Shuah Khan,
linux-tegra, Jonathan Hunter
[-- Attachment #1: Type: text/plain, Size: 451 bytes --]
On Sun, Aug 15, 2021 at 01:42:18AM +0530, 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/tegra/tegra30_ahub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
2021-08-14 20:12 ` Aakash Hemadri
@ 2021-08-16 18:02 ` Bjorn Helgaas
-1 siblings, 0 replies; 24+ messages in thread
From: Bjorn Helgaas @ 2021-08-16 18:02 UTC (permalink / raw)
To: Aakash Hemadri
Cc: Mark Brown, Liam Girdwood, Takashi Iwai, Jawoslav Kysela,
Thierry Reding, Jonathan Hunter, Philipp Zabel, alsa-devel,
linux-tegra, linux-kernel, Shuah Khan, Bjorn Helgaas
On Sun, Aug 15, 2021 at 01:42:18AM +0530, 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/tegra/tegra30_ahub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
> index b3e1df693381..0ac109b32329 100644
> --- a/sound/soc/tegra/tegra30_ahub.c
> +++ b/sound/soc/tegra/tegra30_ahub.c
> @@ -518,7 +518,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
> void __iomem *regs_apbif, *regs_ahub;
> int ret = 0;
>
> - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> + match = of_device_get_match_data(&pdev->dev);
I think this is incorrect.
const struct of_device_id *of_match_device(...)
const void *of_device_get_match_data(...)
of_match_device() returns "struct of_device_id *", i.e., "match".
of_device_get_match_data() calls of_match_device() internally, then
returns "match->data".
> if (!match)
> return -EINVAL;
> soc_data = match->data;
> --
> 2.32.0
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-16 18:02 ` Bjorn Helgaas
0 siblings, 0 replies; 24+ messages in thread
From: Bjorn Helgaas @ 2021-08-16 18:02 UTC (permalink / raw)
To: Aakash Hemadri
Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
Bjorn Helgaas, Mark Brown, Thierry Reding, Philipp Zabel,
Shuah Khan, linux-tegra, Jonathan Hunter
On Sun, Aug 15, 2021 at 01:42:18AM +0530, 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/tegra/tegra30_ahub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
> index b3e1df693381..0ac109b32329 100644
> --- a/sound/soc/tegra/tegra30_ahub.c
> +++ b/sound/soc/tegra/tegra30_ahub.c
> @@ -518,7 +518,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
> void __iomem *regs_apbif, *regs_ahub;
> int ret = 0;
>
> - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> + match = of_device_get_match_data(&pdev->dev);
I think this is incorrect.
const struct of_device_id *of_match_device(...)
const void *of_device_get_match_data(...)
of_match_device() returns "struct of_device_id *", i.e., "match".
of_device_get_match_data() calls of_match_device() internally, then
returns "match->data".
> if (!match)
> return -EINVAL;
> soc_data = match->data;
> --
> 2.32.0
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
2021-08-14 20:12 ` Aakash Hemadri
@ 2021-08-16 18:39 ` Mark Brown
-1 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2021-08-16 18:39 UTC (permalink / raw)
To: Aakash Hemadri
Cc: Liam Girdwood, Takashi Iwai, Jawoslav Kysela, Thierry Reding,
Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
linux-kernel, Shuah Khan, Bjorn Helgaas
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
On Sun, Aug 15, 2021 at 01:42:18AM +0530, Aakash Hemadri wrote:
> - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> + match = of_device_get_match_data(&pdev->dev);
> if (!match)
Thierry, are you sure about your review here? As others have been
pointing out of_device_get_match_data() returns match->data while
of_match_device() returns the device.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-16 18:39 ` Mark Brown
0 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2021-08-16 18:39 UTC (permalink / raw)
To: Aakash Hemadri
Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
Jonathan Hunter, Bjorn Helgaas, Thierry Reding, Philipp Zabel,
Shuah Khan, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
On Sun, Aug 15, 2021 at 01:42:18AM +0530, Aakash Hemadri wrote:
> - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> + match = of_device_get_match_data(&pdev->dev);
> if (!match)
Thierry, are you sure about your review here? As others have been
pointing out of_device_get_match_data() returns match->data while
of_match_device() returns the device.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
2021-08-16 18:39 ` Mark Brown
@ 2021-08-16 19:46 ` Aakash Hemadri
-1 siblings, 0 replies; 24+ messages in thread
From: Aakash Hemadri @ 2021-08-16 19:46 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Takashi Iwai, Jawoslav Kysela, Thierry Reding,
Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
linux-kernel, Shuah Khan, Bjorn Helgaas
On 21/08/16 07:39PM, Mark Brown wrote:
> On Sun, Aug 15, 2021 at 01:42:18AM +0530, Aakash Hemadri wrote:
>
> > - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> > + match = of_device_get_match_data(&pdev->dev);
> > if (!match)
>
> Thierry, are you sure about your review here? As others have been
> pointing out of_device_get_match_data() returns match->data while
> of_match_device() returns the device.
Sorry for the confusion, and the glaring mistake.
Will fix and send v2.
Thanks,
Aakash Hemadri.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-16 19:46 ` Aakash Hemadri
0 siblings, 0 replies; 24+ messages in thread
From: Aakash Hemadri @ 2021-08-16 19:46 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
Jonathan Hunter, Bjorn Helgaas, Thierry Reding, Philipp Zabel,
Shuah Khan, linux-tegra
On 21/08/16 07:39PM, Mark Brown wrote:
> On Sun, Aug 15, 2021 at 01:42:18AM +0530, Aakash Hemadri wrote:
>
> > - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> > + match = of_device_get_match_data(&pdev->dev);
> > if (!match)
>
> Thierry, are you sure about your review here? As others have been
> pointing out of_device_get_match_data() returns match->data while
> of_match_device() returns the device.
Sorry for the confusion, and the glaring mistake.
Will fix and send v2.
Thanks,
Aakash Hemadri.
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
2021-08-16 19:46 ` Aakash Hemadri
@ 2021-08-16 19:49 ` Mark Brown
-1 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2021-08-16 19:49 UTC (permalink / raw)
To: Aakash Hemadri
Cc: Liam Girdwood, Takashi Iwai, Jawoslav Kysela, Thierry Reding,
Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
linux-kernel, Shuah Khan, Bjorn Helgaas
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
On Tue, Aug 17, 2021 at 01:16:21AM +0530, Aakash Hemadri wrote:
> On 21/08/16 07:39PM, Mark Brown wrote:
> > Thierry, are you sure about your review here? As others have been
> > pointing out of_device_get_match_data() returns match->data while
> > of_match_device() returns the device.
> Sorry for the confusion, and the glaring mistake.
> Will fix and send v2.
Since I applied the patches please send an incremental fix on top of
what's been applied rather than a v2.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-16 19:49 ` Mark Brown
0 siblings, 0 replies; 24+ messages in thread
From: Mark Brown @ 2021-08-16 19:49 UTC (permalink / raw)
To: Aakash Hemadri
Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
Jonathan Hunter, Bjorn Helgaas, Thierry Reding, Philipp Zabel,
Shuah Khan, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
On Tue, Aug 17, 2021 at 01:16:21AM +0530, Aakash Hemadri wrote:
> On 21/08/16 07:39PM, Mark Brown wrote:
> > Thierry, are you sure about your review here? As others have been
> > pointing out of_device_get_match_data() returns match->data while
> > of_match_device() returns the device.
> Sorry for the confusion, and the glaring mistake.
> Will fix and send v2.
Since I applied the patches please send an incremental fix on top of
what's been applied rather than a v2.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
2021-08-16 19:49 ` Mark Brown
@ 2021-08-16 19:58 ` Aakash Hemadri
-1 siblings, 0 replies; 24+ messages in thread
From: Aakash Hemadri @ 2021-08-16 19:58 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Takashi Iwai, Jawoslav Kysela, Thierry Reding,
Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
linux-kernel, Shuah Khan, Bjorn Helgaas
On 21/08/16 08:49PM, Mark Brown wrote:
> Since I applied the patches please send an incremental fix on top of
> what's been applied rather than a v2.
Will do Mark!
Thank,
Aakash Hemadri
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-16 19:58 ` Aakash Hemadri
0 siblings, 0 replies; 24+ messages in thread
From: Aakash Hemadri @ 2021-08-16 19:58 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, linux-kernel, Takashi Iwai, Liam Girdwood,
Jonathan Hunter, Bjorn Helgaas, Thierry Reding, Philipp Zabel,
Shuah Khan, linux-tegra
On 21/08/16 08:49PM, Mark Brown wrote:
> Since I applied the patches please send an incremental fix on top of
> what's been applied rather than a v2.
Will do Mark!
Thank,
Aakash Hemadri
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
2021-08-16 18:39 ` Mark Brown
@ 2021-08-17 13:52 ` Thierry Reding
-1 siblings, 0 replies; 24+ messages in thread
From: Thierry Reding @ 2021-08-17 13:52 UTC (permalink / raw)
To: Mark Brown, Bjorn Helgaas
Cc: Aakash Hemadri, Liam Girdwood, Takashi Iwai, Jawoslav Kysela,
Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
linux-kernel, Shuah Khan
[-- Attachment #1: Type: text/plain, Size: 686 bytes --]
On Mon, Aug 16, 2021 at 07:39:06PM +0100, Mark Brown wrote:
> On Sun, Aug 15, 2021 at 01:42:18AM +0530, Aakash Hemadri wrote:
>
> > - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> > + match = of_device_get_match_data(&pdev->dev);
> > if (!match)
>
> Thierry, are you sure about your review here? As others have been
> pointing out of_device_get_match_data() returns match->data while
> of_match_device() returns the device.
Ugh... good catch. I (naively) assumed this was a mechanical conversion
like one of the many others that have been making the rounds and
evidently wasn't paying enough attention.
Thanks for spotting this, Bjorn!
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
@ 2021-08-17 13:52 ` Thierry Reding
0 siblings, 0 replies; 24+ messages in thread
From: Thierry Reding @ 2021-08-17 13:52 UTC (permalink / raw)
To: Mark Brown, Bjorn Helgaas
Cc: alsa-devel, Aakash Hemadri, linux-kernel, Takashi Iwai,
Liam Girdwood, Jonathan Hunter, Philipp Zabel, Shuah Khan,
linux-tegra
[-- Attachment #1: Type: text/plain, Size: 686 bytes --]
On Mon, Aug 16, 2021 at 07:39:06PM +0100, Mark Brown wrote:
> On Sun, Aug 15, 2021 at 01:42:18AM +0530, Aakash Hemadri wrote:
>
> > - match = of_match_device(tegra30_ahub_of_match, &pdev->dev);
> > + match = of_device_get_match_data(&pdev->dev);
> > if (!match)
>
> Thierry, are you sure about your review here? As others have been
> pointing out of_device_get_match_data() returns match->data while
> of_match_device() returns the device.
Ugh... good catch. I (naively) assumed this was a mechanical conversion
like one of the many others that have been making the rounds and
evidently wasn't paying enough attention.
Thanks for spotting this, Bjorn!
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread