The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <stable@xxxxxxxxxxxxxxx>. To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.4.y git checkout FETCH_HEAD git cherry-pick -x f9c058d14f4fe23ef523a7ff73734d51c151683c # <resolve conflicts, build, test, etc.> git commit -s git send-email --to '<stable@xxxxxxxxxxxxxxx>' --in-reply-to '2023072316-squatting-handiness-1c06@gregkh' --subject-prefix 'PATCH 5.4.y' HEAD^.. Possible dependencies: f9c058d14f4f ("ASoC: mediatek: mt8173: Fix irq error path") 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready") 8c32984bc7da ("ASoC: mediatek: mt8173: Fix debugfs registration for components") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From f9c058d14f4fe23ef523a7ff73734d51c151683c Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Delgado <ribalda@xxxxxxxxxxxx> Date: Mon, 12 Jun 2023 11:05:32 +0200 Subject: [PATCH] ASoC: mediatek: mt8173: Fix irq error path After reordering the irq probe, the error path was not properly done. Lets fix it. Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Cc: stable@xxxxxxxxxx Fixes: 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready") Signed-off-by: Ricardo Ribalda Delgado <ribalda@xxxxxxxxxxxx> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-2-432aa99ce24d@xxxxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c index ff25c44070a3..06269f7e3756 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -1070,6 +1070,10 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) afe->dev = &pdev->dev; + irq_id = platform_get_irq(pdev, 0); + if (irq_id <= 0) + return irq_id < 0 ? irq_id : -ENXIO; + afe->base_addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(afe->base_addr)) return PTR_ERR(afe->base_addr); @@ -1175,14 +1179,11 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) if (ret) goto err_cleanup_components; - irq_id = platform_get_irq(pdev, 0); - if (irq_id <= 0) - return irq_id < 0 ? irq_id : -ENXIO; ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler, 0, "Afe_ISR_Handle", (void *)afe); if (ret) { dev_err(afe->dev, "could not request_irq\n"); - goto err_pm_disable; + goto err_cleanup_components; } dev_info(&pdev->dev, "MT8173 AFE driver initialized.\n");