linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: tegra30: Fix use of of_device_get_match_data
@ 2021-08-16 21:14 Aakash Hemadri
  2021-08-16 21:14 ` [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage " Aakash Hemadri
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Aakash Hemadri @ 2021-08-16 21:14 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter,
	Philipp Zabel, alsa-devel, linux-tegra, linux-kernel, Shuah Khan,
	Bjorn Helgaas

Hi,
This patchset fixes my previous incorrect patches.

356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data")
80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data")

Aakash Hemadri (2):
  ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
  ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data

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

-- 
2.32.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
  2021-08-16 21:14 [PATCH 0/2] ASoC: tegra30: Fix use of of_device_get_match_data Aakash Hemadri
@ 2021-08-16 21:14 ` Aakash Hemadri
  2021-08-17 13:55   ` Thierry Reding
  2021-08-16 21:14 ` [PATCH 2/2] ASoC: tegra30: i2s: " Aakash Hemadri
  2021-08-17 14:22 ` [PATCH 0/2] ASoC: tegra30: Fix use " Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Aakash Hemadri @ 2021-08-16 21:14 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter,
	Philipp Zabel, alsa-devel, linux-tegra, linux-kernel, Shuah Khan,
	Bjorn Helgaas

const struct of_device_id incorrectly assigned "match->data" using
of_device_get_match_data()

Instead assign `const struct tegra30_ahub_soc_data *soc_data` with
const void *of_device_get_match_data(...)

Fixes: 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data")

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
---
 sound/soc/tegra/tegra30_ahub.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
index 0ac109b32329..ef011a488ceb 100644
--- a/sound/soc/tegra/tegra30_ahub.c
+++ b/sound/soc/tegra/tegra30_ahub.c
@@ -512,16 +512,14 @@ static const struct of_device_id tegra30_ahub_of_match[] = {
 
 static int tegra30_ahub_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *match;
 	const struct tegra30_ahub_soc_data *soc_data;
 	struct resource *res0;
 	void __iomem *regs_apbif, *regs_ahub;
 	int ret = 0;
 
-	match = of_device_get_match_data(&pdev->dev);
-	if (!match)
+	soc_data = of_device_get_match_data(&pdev->dev);
+	if (!soc_data)
 		return -EINVAL;
-	soc_data = match->data;
 
 	ahub = devm_kzalloc(&pdev->dev, sizeof(struct tegra30_ahub),
 			    GFP_KERNEL);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data
  2021-08-16 21:14 [PATCH 0/2] ASoC: tegra30: Fix use of of_device_get_match_data Aakash Hemadri
  2021-08-16 21:14 ` [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage " Aakash Hemadri
@ 2021-08-16 21:14 ` Aakash Hemadri
  2021-08-17 13:57   ` Thierry Reding
  2021-08-17 14:22 ` [PATCH 0/2] ASoC: tegra30: Fix use " Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Aakash Hemadri @ 2021-08-16 21:14 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter,
	Philipp Zabel, alsa-devel, linux-tegra, linux-kernel, Shuah Khan,
	Bjorn Helgaas

const struct of_device_id incorrectly assigned "match->data" using
    of_device_get_match_data()

Instead assign `const struct tegra30_i2s_soc_data *soc_data` with
const void *of_device_get_match_data(...)

Fixes: 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data")

Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
---
 sound/soc/tegra/tegra30_i2s.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index d4c5594efaf1..084a533bf4f2 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -406,7 +406,7 @@ static const struct of_device_id tegra30_i2s_of_match[] = {
 static int tegra30_i2s_platform_probe(struct platform_device *pdev)
 {
 	struct tegra30_i2s *i2s;
-	const struct of_device_id *match;
+	const struct tegra30_i2s_soc_data *soc_data;
 	u32 cif_ids[2];
 	void __iomem *regs;
 	int ret;
@@ -418,13 +418,13 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
 	}
 	dev_set_drvdata(&pdev->dev, i2s);
 
-	match = of_device_get_match_data(&pdev->dev);
-	if (!match) {
+	soc_data = of_device_get_match_data(&pdev->dev);
+	if (!soc_data) {
 		dev_err(&pdev->dev, "Error: No device match found\n");
 		ret = -ENODEV;
 		goto err;
 	}
-	i2s->soc_data = (struct tegra30_i2s_soc_data *)match->data;
+	i2s->soc_data = soc_data;
 
 	i2s->dai = tegra30_i2s_dai_template;
 	i2s->dai.name = dev_name(&pdev->dev);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
  2021-08-16 21:14 ` [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage " Aakash Hemadri
@ 2021-08-17 13:55   ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2021-08-17 13:55 UTC (permalink / raw)
  To: Aakash Hemadri
  Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
	linux-kernel, Shuah Khan, Bjorn Helgaas

[-- Attachment #1: Type: text/plain, Size: 1687 bytes --]

On Tue, Aug 17, 2021 at 02:44:51AM +0530, Aakash Hemadri wrote:
> const struct of_device_id incorrectly assigned "match->data" using
> of_device_get_match_data()
> 
> Instead assign `const struct tegra30_ahub_soc_data *soc_data` with
> const void *of_device_get_match_data(...)
> 
> Fixes: 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data")
> 
> Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
> ---
>  sound/soc/tegra/tegra30_ahub.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
> index 0ac109b32329..ef011a488ceb 100644
> --- a/sound/soc/tegra/tegra30_ahub.c
> +++ b/sound/soc/tegra/tegra30_ahub.c
> @@ -512,16 +512,14 @@ static const struct of_device_id tegra30_ahub_of_match[] = {
>  
>  static int tegra30_ahub_probe(struct platform_device *pdev)
>  {
> -	const struct of_device_id *match;
>  	const struct tegra30_ahub_soc_data *soc_data;
>  	struct resource *res0;
>  	void __iomem *regs_apbif, *regs_ahub;
>  	int ret = 0;
>  
> -	match = of_device_get_match_data(&pdev->dev);
> -	if (!match)
> +	soc_data = of_device_get_match_data(&pdev->dev);
> +	if (!soc_data)
>  		return -EINVAL;
> -	soc_data = match->data;

Minor nit: !soc_data can actually never happen for this driver. First,
tegra30_ahub_probe() will only ever be called if there was a match with
an entry from the OF device ID table, and then all entries have .data
set to a valid point.

It's a pre-existing issue, but since all of the surrounding code is
already getting updated, perhaps it'd be a good idea to fix that up
while at it.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data
  2021-08-16 21:14 ` [PATCH 2/2] ASoC: tegra30: i2s: " Aakash Hemadri
@ 2021-08-17 13:57   ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2021-08-17 13:57 UTC (permalink / raw)
  To: Aakash Hemadri
  Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Jonathan Hunter, Philipp Zabel, alsa-devel, linux-tegra,
	linux-kernel, Shuah Khan, Bjorn Helgaas

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

On Tue, Aug 17, 2021 at 02:44:52AM +0530, Aakash Hemadri wrote:
> const struct of_device_id incorrectly assigned "match->data" using
>     of_device_get_match_data()
> 
> Instead assign `const struct tegra30_i2s_soc_data *soc_data` with
> const void *of_device_get_match_data(...)
> 
> Fixes: 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data")
> 
> Signed-off-by: Aakash Hemadri <aakashhemadri123@gmail.com>
> ---
>  sound/soc/tegra/tegra30_i2s.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
> index d4c5594efaf1..084a533bf4f2 100644
> --- a/sound/soc/tegra/tegra30_i2s.c
> +++ b/sound/soc/tegra/tegra30_i2s.c
> @@ -406,7 +406,7 @@ static const struct of_device_id tegra30_i2s_of_match[] = {
>  static int tegra30_i2s_platform_probe(struct platform_device *pdev)
>  {
>  	struct tegra30_i2s *i2s;
> -	const struct of_device_id *match;
> +	const struct tegra30_i2s_soc_data *soc_data;
>  	u32 cif_ids[2];
>  	void __iomem *regs;
>  	int ret;
> @@ -418,13 +418,13 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
>  	}
>  	dev_set_drvdata(&pdev->dev, i2s);
>  
> -	match = of_device_get_match_data(&pdev->dev);
> -	if (!match) {
> +	soc_data = of_device_get_match_data(&pdev->dev);
> +	if (!soc_data) {
>  		dev_err(&pdev->dev, "Error: No device match found\n");
>  		ret = -ENODEV;
>  		goto err;
>  	}
> -	i2s->soc_data = (struct tegra30_i2s_soc_data *)match->data;
> +	i2s->soc_data = soc_data;

Same comment as for the AHUB patch, although there's a bit more
potential to save boilerplate here. For instance, there's really no need
for the local "soc_data" variable here, so you can assign to
i2s->soc_data directly and then leave out the unnecessary check as well.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] ASoC: tegra30: Fix use of of_device_get_match_data
  2021-08-16 21:14 [PATCH 0/2] ASoC: tegra30: Fix use of of_device_get_match_data Aakash Hemadri
  2021-08-16 21:14 ` [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage " Aakash Hemadri
  2021-08-16 21:14 ` [PATCH 2/2] ASoC: tegra30: i2s: " Aakash Hemadri
@ 2021-08-17 14:22 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-08-17 14:22 UTC (permalink / raw)
  To: Liam Girdwood, Aakash Hemadri
  Cc: Mark Brown, Jonathan Hunter, linux-tegra, linux-kernel,
	Thierry Reding, Shuah Khan, Bjorn Helgaas, Takashi Iwai,
	alsa-devel, Philipp Zabel, Jaroslav Kysela

On Tue, 17 Aug 2021 02:44:50 +0530, Aakash Hemadri wrote:
> This patchset fixes my previous incorrect patches.
> 
> 356b94a32a75 ("ASoC: tegra30: i2s: Use of_device_get_match_data")
> 80165bb80433 ("ASoC: tegra30: ahub: Use of_device_get_match_data")
> 
> Aakash Hemadri (2):
>   ASoC: tegra30: ahub: Fix incorrect usage of of_device_get_match_data
>   ASoC: tegra30: i2s: Fix incorrect usage of 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: Fix incorrect usage of of_device_get_match_data
      commit: ea2efedefbc34f782db396c3d90e80aa1fff57a5
[2/2] ASoC: tegra30: i2s: Fix incorrect usage of of_device_get_match_data
      commit: 240fdf3f42fc6505adecaf5a74fac75b3c702cf1

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-17 14:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16 21:14 [PATCH 0/2] ASoC: tegra30: Fix use of of_device_get_match_data Aakash Hemadri
2021-08-16 21:14 ` [PATCH 1/2] ASoC: tegra30: ahub: Fix incorrect usage " Aakash Hemadri
2021-08-17 13:55   ` Thierry Reding
2021-08-16 21:14 ` [PATCH 2/2] ASoC: tegra30: i2s: " Aakash Hemadri
2021-08-17 13:57   ` Thierry Reding
2021-08-17 14:22 ` [PATCH 0/2] ASoC: tegra30: Fix use " Mark Brown

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).