mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers
@ 2026-08-11  4:24 Rosen Penev
  2026-08-12 15:57 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-08-11  4:24 UTC (permalink / raw)
  To: linux-sound
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Matthias Brugger, AngeloGioacchino Del Regno,
	open list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

Simplify the probe function by using devm_platform_ioremap_resource()
for the base address and devm_platform_get_and_ioremap_resource() for
the SRAM, dropping the manual platform_get_resource() calls.

Assisted-by: opencode:deepseek-v4-flash-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 sound/soc/mediatek/mt8365/mt8365-afe-pcm.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
index dcbc5a345382..fc3a457683b8 100644
--- a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
+++ b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
@@ -2121,19 +2121,15 @@ static int mt8365_afe_pcm_dev_probe(struct platform_device *pdev)
 	spin_lock_init(&afe_priv->afe_ctrl_lock);
 	mutex_init(&afe_priv->afe_clk_mutex);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	afe->base_addr = devm_ioremap_resource(&pdev->dev, res);
+	afe->base_addr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(afe->base_addr))
 		return PTR_ERR(afe->base_addr);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (res) {
-		afe_priv->afe_sram_vir_addr =
-			devm_ioremap_resource(&pdev->dev, res);
-		if (!IS_ERR(afe_priv->afe_sram_vir_addr)) {
-			afe_priv->afe_sram_phy_addr = res->start;
-			afe_priv->afe_sram_size = resource_size(res);
-		}
+	afe_priv->afe_sram_vir_addr =
+		devm_platform_get_and_ioremap_resource(pdev, 1, &res);
+	if (!IS_ERR(afe_priv->afe_sram_vir_addr)) {
+		afe_priv->afe_sram_phy_addr = res->start;
+		afe_priv->afe_sram_size = resource_size(res);
 	}
 
 	/* initial audio related clock */
-- 
2.55.0


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

* Re: [PATCH] ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers
  2026-08-11  4:24 [PATCH] ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers Rosen Penev
@ 2026-08-12 15:57 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-08-12 15:57 UTC (permalink / raw)
  To: linux-sound, Rosen Penev
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Matthias Brugger,
	AngeloGioacchino Del Regno, linux-kernel, linux-arm-kernel,
	linux-mediatek

On Mon, 10 Aug 2026 21:24:24 -0700, Rosen Penev wrote:
> ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers

Applied to

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

Thanks!

[1/1] ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers
      https://git.kernel.org/broonie/sound/c/3d7fb01b36aa

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] 2+ messages in thread

end of thread, other threads:[~2026-08-12 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-11  4:24 [PATCH] ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers Rosen Penev
2026-08-12 15:57 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®