Skip to contentSkip to conversation

ASoC: Intel: bytcht_cx2072x: Replace open coded acpi_dev_put()

PATCH In review Andy Shevchenko 3 participants 16 messages Jan 2, 2023 – Jan 9, 2023

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

PATCH 1/5 ASoC: Intel: bytcht_cx2072x: Replace open coded acpi_dev_put()

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

---
 sound/soc/intel/boards/bytcht_cx2072x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/bytcht_cx2072x.c +1 -1
index 41cec67157b6..9942a2de6f7a 100644
@@ -253,9 +253,9 @@ static int snd_byt_cht_cx2072x_probe(struct platform_device *pdev)
 	if (adev) {
 		snprintf(codec_name, sizeof(codec_name), "i2c-%s",
 			 acpi_dev_name(adev));
-		put_device(&adev->dev);
 		byt_cht_cx2072x_dais[dai_index].codecs->name = codec_name;
 	}
+	acpi_dev_put(adev);
 
 	/* override platform name, if required */
 	ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_cx2072x_card,
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/5 ASoC: Intel: bytcht_da7213: Replace open coded acpi_dev_put()

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

---
 sound/soc/intel/boards/bytcht_da7213.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/bytcht_da7213.c +1 -1
index a0c8f1d3f8ce..a3b0cfab17b0 100644
@@ -256,9 +256,9 @@ static int bytcht_da7213_probe(struct platform_device *pdev)
 	if (adev) {
 		snprintf(codec_name, sizeof(codec_name),
 			 "i2c-%s", acpi_dev_name(adev));
-		put_device(&adev->dev);
 		dailink[dai_index].codecs->name = codec_name;
 	}
+	acpi_dev_put(adev);
 
 	/* override platform name, if required */
 	platform_name = mach->mach_params.platform;
Signature · 1 line
2.35.1
#2 lore raw

PATCH 3/5 ASoC: Intel: cht_bsw_rt5645: Replace open coded acpi_dev_put()

In reply to Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

---
 sound/soc/intel/boards/cht_bsw_rt5645.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_rt5645.c +1 -1
index 25a054bd4073..875bc0b3d85d 100644
@@ -581,9 +581,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	if (adev) {
 		snprintf(cht_rt5645_codec_name, sizeof(cht_rt5645_codec_name),
 			 "i2c-%s", acpi_dev_name(adev));
-		put_device(&adev->dev);
 		cht_dailink[dai_index].codecs->name = cht_rt5645_codec_name;
 	}
+	acpi_dev_put(adev);
 
 	/*
 	 * swap SSP0 if bytcr is detected
Signature · 1 line
2.35.1
#3 lore raw

PATCH 4/5 ASoC: Intel: cht_bsw_rt5672: Replace open coded acpi_dev_put()

In reply to Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

---
 sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/cht_bsw_rt5672.c +1 -1
index 49d3da8f7316..daa630a0efc1 100644
@@ -473,9 +473,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
 	if (adev) {
 		snprintf(drv->codec_name, sizeof(drv->codec_name),
 			 "i2c-%s", acpi_dev_name(adev));
-		put_device(&adev->dev);
 		cht_dailink[dai_index].codecs->name = drv->codec_name;
 	}
+	acpi_dev_put(adev);
 
 	/* Use SSP0 on Bay Trail CR devices */
 	if (soc_intel_is_byt() && mach->mach_params.acpi_ipc_irq_index == 0) {
Signature · 1 line
2.35.1
#4 lore raw

PATCH 5/5 ASoC: Intel: sof-wm8804: Replace open coded acpi_dev_put()

In reply to Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

---
 sound/soc/intel/boards/sof_wm8804.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/sof_wm8804.c +1 -1
index 54395e2ededc..fbad5a73de44 100644
@@ -269,9 +269,9 @@ static int sof_wm8804_probe(struct platform_device *pdev)
 	if (adev) {
 		snprintf(codec_name, sizeof(codec_name),
 			 "%s%s", "i2c-", acpi_dev_name(adev));
-		put_device(&adev->dev);
 		dailink[dai_index].codecs->name = codec_name;
 	}
+	acpi_dev_put(adev);
 
 	snd_soc_card_set_drvdata(card, ctx);
 
Signature · 1 line
2.35.1
#5 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

Answering for the series: we should make the change across all Intel machine drivers. I see at least four cases that were missed

bytcr_rt5640.c:         put_device(&adev->dev);
bytcr_rt5651.c:         put_device(&adev->dev);
bytcr_wm5102.c: put_device(&adev->dev);
sof_es8336.c:           put_device(&adev->dev);
Quoted 19 lines
---
 sound/soc/intel/boards/bytcht_cx2072x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/bytcht_cx2072x.c +1 -1
index 41cec67157b6..9942a2de6f7a 100644
@@ -253,9 +253,9 @@ static int snd_byt_cht_cx2072x_probe(struct platform_device *pdev)
 	if (adev) {
 		snprintf(codec_name, sizeof(codec_name), "i2c-%s",
 			 acpi_dev_name(adev));
-		put_device(&adev->dev);
 		byt_cht_cx2072x_dais[dai_index].codecs->name = codec_name;
 	}
+	acpi_dev_put(adev);
 
 	/* override platform name, if required */
 	ret = snd_soc_fixup_dai_links_platform_name(&byt_cht_cx2072x_card,
#6 lore raw
Quoted 10 lines · Pierre-Louis Bossart
Quoted 8 lines · Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

Quoted 7 lines

Answering for the series: we should make the change across all Intel machine drivers. I see at least four cases that were missed

bytcr_rt5640.c:         put_device(&adev->dev);
bytcr_rt5651.c:         put_device(&adev->dev);
bytcr_wm5102.c: put_device(&adev->dev);
sof_es8336.c:           put_device(&adev->dev);

Aren't they (they all problematic, btw) covered by the fixes series
https://lore.kernel.org/r/[email protected]?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw
Quoted 14 lines · Andy Shevchenko
Quoted 13 lines · Pierre-Louis Bossart
Quoted 8 lines · Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

Answering for the series: we should make the change across all Intel machine drivers. I see at least four cases that were missed

Quoted 7 lines
Quoted 4 lines
bytcr_rt5640.c:         put_device(&adev->dev);
bytcr_rt5651.c:         put_device(&adev->dev);
bytcr_wm5102.c: put_device(&adev->dev);
sof_es8336.c:           put_device(&adev->dev);

Aren't they (they all problematic, btw) covered by the fixes series
https://lore.kernel.org/r/[email protected]?

They are indeed, but if you group AMD-related patches with Intel ones, it's only human for reviewers to skip the thread entirely, even more so when catching up with email on January 3 :-)

For this series

#9 lore raw
Quoted 8 lines · Mark Brown
Quoted 3 lines · Pierre-Louis Bossart

For this series

According to b4 you've only acked the first patch here because Andy doesn't send cover letters :/

Is b4 capable to spread tags from cover letter to the whole series? (Sorry, I'm a bit outdated with all Swiss-knife possibilities that
b4 provides)

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#10 lore raw
Quoted 8 lines · Andy Shevchenko
Quoted 2 lines · Mark Brown

According to b4 you've only acked the first patch here because Andy doesn't send cover letters :/

Is b4 capable to spread tags from cover letter to the whole series? (Sorry, I'm a bit outdated with all Swiss-knife possibilities that
b4 provides)

Yes, it does that.

#11 lore raw
Quoted 11 lines · Mark Brown
Quoted 8 lines · Andy Shevchenko
Quoted 2 lines · Mark Brown

According to b4 you've only acked the first patch here because Andy doesn't send cover letters :/

Is b4 capable to spread tags from cover letter to the whole series? (Sorry, I'm a bit outdated with all Swiss-knife possibilities that
b4 provides)

Yes, it does that.

Oh, cool to know! So it makes a lot of sense to create the cover letters even for straightforward independent changes that are united into the series for the easy handling.

Thank you!

P.S. Tell me if I need to resend with tags applied this time?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#12 lore raw
Quoted 1 line · Andy Shevchenko

P.S. Tell me if I need to resend with tags applied this time?

No.

#13 lore raw
In reply to Pierre-Louis Bossart
Quoted 20 lines · Pierre-Louis Bossart
Quoted 19 lines · Andy Shevchenko
Quoted 17 lines · Pierre-Louis Bossart
Quoted 8 lines · Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

Answering for the series: we should make the change across all Intel machine drivers. I see at least four cases that were missed

bytcr_rt5640.c:         put_device(&adev->dev);
bytcr_rt5651.c:         put_device(&adev->dev);
bytcr_wm5102.c: put_device(&adev->dev);
sof_es8336.c:           put_device(&adev->dev);
Quoted 6 lines
Quoted 2 lines

Aren't they (they all problematic, btw) covered by the fixes series
https://lore.kernel.org/r/[email protected]?

They are indeed, but if you group AMD-related patches with Intel ones, it's only human for reviewers to skip the thread entirely, even more so when catching up with email on January 3 :-)

Ah, I will try to remember to split also by platform (there are not many that's why I decided to group them by the problem type only).

Quoted 3 lines

For this series

Thank you and HNY!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#14 lore raw
In reply to Pierre-Louis Bossart
Quoted 3 lines · Pierre-Louis Bossart
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Pierre-Louis Bossart

On 1/2/23 14:30, Andy Shevchenko wrote:

...

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

I see at least four cases that were missed

bytcr_rt5640.c:         put_device(&adev->dev);
bytcr_rt5651.c:         put_device(&adev->dev);
bytcr_wm5102.c: put_device(&adev->dev);
sof_es8336.c:           put_device(&adev->dev);
Quoted 6 lines
Quoted 2 lines

Aren't they (they all problematic, btw) covered by the fixes series
https://lore.kernel.org/r/[email protected]?

They are indeed, but if you group AMD-related patches with Intel ones, it's only human for reviewers to skip the thread entirely, even more so when catching up with email on January 3 :-)

I'm not sure what should I do about that series. Shall I split AMD and Intel parts? (Assuming Intel will go as a series with cover letter.)

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#15 lore raw
In reply to Andy Shevchenko
Quoted 8 lines · Andy Shevchenko

Instead of calling put_device(&adev->dev) where adev is a pointer to an ACPI device, use specific call, i.e. acpi_dev_put().

Also move it out of the conditional to make it more visible in case some other code will be added which may use that pointer. We need to keep a reference as long as we use the pointer.

[...]

Applied to

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

Thanks!

[1/5] ASoC: Intel: bytcht_cx2072x: Replace open coded acpi_dev_put()

      commit: 7baff1a9debc5f4ff0d6bc1496358e251f66e396
[2/5] ASoC: Intel: bytcht_da7213: Replace open coded acpi_dev_put()
      commit: 4afda6de02285758c9b892a2e79658966d3cfbb0
[3/5] ASoC: Intel: cht_bsw_rt5645: Replace open coded acpi_dev_put()
      commit: 5360a1c0f251b8000e9b2ea7b9f9e40c2e8f1c83
[4/5] ASoC: Intel: cht_bsw_rt5672: Replace open coded acpi_dev_put()
      commit: 6736dd4e5b58f27983ab3dba5fa96ed97768beaf
[5/5] ASoC: Intel: sof-wm8804: Replace open coded acpi_dev_put()
      commit: 892dbe0ecf658fd23e0a7255fca26a216cf54f96

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