2021-08-14 20:14:45

by Aakash Hemadri

[permalink] [raw]
Subject: [PATCH 0/2] ASoC: tegra: Use of_device_get_match_data

Hi,
Prefer `of_device_get_match_data` over `of_match_device`. This patch
replaces of_match_device with of_device_get_match_data.

This patch series will apply cleanly on for-next

Aakash Hemadri (2):
ASoC: tegra30: ahub: Use of_device_get_match_data
ASoC: tegra30: i2s: Use of_device_get_match_data

sound/soc/tegra/tegra30_ahub.c | 2 +-
sound/soc/tegra/tegra30_i2s.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

--
2.32.0


2021-08-14 20:15:24

by Aakash Hemadri

[permalink] [raw]
Subject: [PATCH 2/2] ASoC: tegra30: i2s: Use of_device_get_match_data

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 <[email protected]>
---
sound/soc/tegra/tegra30_i2s.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 36344f0a64c1..d4c5594efaf1 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -418,7 +418,7 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
}
dev_set_drvdata(&pdev->dev, i2s);

- match = of_match_device(tegra30_i2s_of_match, &pdev->dev);
+ match = of_device_get_match_data(&pdev->dev);
if (!match) {
dev_err(&pdev->dev, "Error: No device match found\n");
ret = -ENODEV;
--
2.32.0

2021-08-14 20:17:18

by Aakash Hemadri

[permalink] [raw]
Subject: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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 <[email protected]>
---
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

2021-08-16 09:56:04

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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 <[email protected]>
> ---
> sound/soc/tegra/tegra30_ahub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (451.00 B)
signature.asc (849.00 B)
Download all attachments

2021-08-16 09:56:58

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 2/2] ASoC: tegra30: i2s: Use of_device_get_match_data

On Sun, Aug 15, 2021 at 01:42:19AM +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 <[email protected]>
> ---
> sound/soc/tegra/tegra30_i2s.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (450.00 B)
signature.asc (849.00 B)
Download all attachments

2021-08-16 17:07:00

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/2] ASoC: tegra: Use of_device_get_match_data

On Sun, 15 Aug 2021 01:42:17 +0530, Aakash Hemadri wrote:
> Prefer `of_device_get_match_data` over `of_match_device`. This patch
> replaces of_match_device with of_device_get_match_data.
>
> This patch series will apply cleanly on for-next
>
> Aakash Hemadri (2):
> ASoC: tegra30: ahub: Use of_device_get_match_data
> ASoC: tegra30: i2s: Use of_device_get_match_data
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
commit: 80165bb8043391f4ef4916bde947a4d805a54aa6
[2/2] ASoC: tegra30: i2s: Use of_device_get_match_data
commit: 356b94a32a75203616e5a7c3cd2b19101bc87086

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

2021-08-16 18:06:47

by Bjorn Helgaas

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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 <[email protected]>
> ---
> 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
>

2021-08-16 18:40:25

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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.


Attachments:
(No filename) (376.00 B)
signature.asc (499.00 B)
Download all attachments

2021-08-16 19:48:36

by Aakash Hemadri

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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.

2021-08-16 19:54:04

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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.


Attachments:
(No filename) (486.00 B)
signature.asc (499.00 B)
Download all attachments

2021-08-16 20:00:25

by Aakash Hemadri

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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

2021-08-17 13:54:24

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data

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


Attachments:
(No filename) (686.00 B)
signature.asc (849.00 B)
Download all attachments