ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers
Subsystems (3)
PATCH 1/1 ASoC: mediatek: mt8365: use devm_platform_ioremap_resource helpers
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.
--- sound/soc/mediatek/mt8365/mt8365-afe-pcm.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
sound/soc/mediatek/mt8365/mt8365-afe-pcm.c +6 -10
@@ -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 */
Signature · 1 line
2.55.0
Mark Brown
maintainerQuoted 1 line · Rosen Penev
ASoC: mediatek: mt8365: use
devm_platform_ioremap_resourcehelpers
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