Skip to contentSkip to conversation

ASoC: tegra: Use of_device_get_match_data

PATCH In review Aakash Hemadri 4 participants 12 messages Aug 14, 2021 – Aug 17, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
2.32.0
#1 lore raw

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.

---
 sound/soc/tegra/tegra30_ahub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/tegra/tegra30_ahub.c +1 -1
index b3e1df693381..0ac109b32329 100644
@@ -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;
Signature · 1 line
2.32.0
Acked-by on v1 1/2
#2 lore raw

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

Quoted 9 lines · Aakash Hemadri

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.

---
 sound/soc/tegra/tegra30_ahub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#3 lore raw

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

In reply to Aakash Hemadri
Quoted 15 lines · Aakash Hemadri

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.

---
 sound/soc/tegra/tegra30_ahub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/tegra/tegra30_ahub.c +0 -0
index b3e1df693381..0ac109b32329 100644

sound/soc/tegra/tegra30_ahub.c static int tegra30_ahub_probe(struct platform_device *pdev) · line 521

Quoted 5 lines
sound/soc/tegra/tegra30_ahub.c +1 -1
@@ -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".

Quoted 6 lines
sound/soc/tegra/tegra30_ahub.c +0 -0
 	if (!match)
 		return -EINVAL;
 	soc_data = match->data;
Signature · 1 line
2.32.0
maintainer
#4 lore raw

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

In reply to Aakash Hemadri

sound/soc/tegra/tegra30_ahub.c static int tegra30_ahub_probe(struct platform_device *pdev) · line 522

Quoted 3 lines · Aakash Hemadri
sound/soc/tegra/tegra30_ahub.c +1 -1
-	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.

#5 lore raw

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

Quoted 9 lines · Mark Brown

sound/soc/tegra/tegra30_ahub.c static int tegra30_ahub_probe(struct platform_device *pdev) · line 522

Quoted 3 lines · Aakash Hemadri
sound/soc/tegra/tegra30_ahub.c +1 -1
-	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.

maintainer
#6 lore raw

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

Quoted 8 lines · Aakash Hemadri
Quoted 3 lines · Mark Brown

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.

#7 lore raw

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

Quoted 2 lines · Mark Brown

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

#8 lore raw

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

In reply to Mark Brown
Quoted 9 lines · Mark Brown

sound/soc/tegra/tegra30_ahub.c static int tegra30_ahub_probe(struct platform_device *pdev) · line 522

Quoted 3 lines · Aakash Hemadri
sound/soc/tegra/tegra30_ahub.c +1 -1
-	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

#9 lore raw

PATCH 2/2 ASoC: tegra30: i2s: Use of_device_get_match_data

In reply to Aakash Hemadri

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.

---
 sound/soc/tegra/tegra30_i2s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/tegra/tegra30_i2s.c +1 -1
index 36344f0a64c1..d4c5594efaf1 100644
@@ -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;
Signature · 1 line
2.32.0
Acked-by on v1 2/2
#10 lore raw

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

Quoted 9 lines · Aakash Hemadri

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.

---
 sound/soc/tegra/tegra30_i2s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
maintainer
#11 lore raw
In reply to Aakash Hemadri
Quoted 10 lines · Aakash Hemadri

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