ASoC: tegra: Use of_device_get_match_data
Subsystems (3)
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
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
@@ -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
Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
Quoted 9 lines · Aakash Hemadri
Prefer
of_device_get_match_dataoverof_match_deviceRetrieve 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(-)
Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
In reply to Aakash HemadriQuoted 15 lines · Aakash Hemadri
Prefer
of_device_get_match_dataoverof_match_deviceRetrieve 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(-)sound/soc/tegra/tegra30_ahub.c +0
-0
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
-0if (!match)return -EINVAL ; soc_data = match->data;Signature · 1 line
2.32.0
Mark Brown
maintainerRe: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
In reply to Aakash Hemadrisound/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.
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()returnsmatch->datawhileof_match_device()returns the device.
Sorry for the confusion, and the glaring mistake.
Will fix and send v2.
Thanks,
Aakash Hemadri.
Mark Brown
maintainerRe: [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()returnsmatch->datawhileof_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.
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
Re: [PATCH 1/2] ASoC: tegra30: ahub: Use of_device_get_match_data
In reply to Mark BrownQuoted 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()returnsmatch->datawhileof_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
PATCH 2/2 ASoC: tegra30: i2s: Use of_device_get_match_data
In reply to Aakash HemadriPrefer 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
@@ -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
Re: [PATCH 2/2] ASoC: tegra30: i2s: Use of_device_get_match_data
Quoted 9 lines · Aakash Hemadri
Prefer
of_device_get_match_dataoverof_match_deviceRetrieve 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(-)
Mark Brown
maintainerQuoted 10 lines · Aakash Hemadri
Prefer
of_device_get_match_dataoverof_match_device. This patch
replacesof_match_devicewithof_device_get_match_data.This patch series will apply cleanly on for-next
Aakash Hemadri (2):
ASoC: tegra30: ahub: Useof_device_get_match_data
ASoC: tegra30: i2s: Useof_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: 356b94a32a75203616e5a7c3cd2b19101bc87086All 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