From: Tang Bin Date: Sun, 8 Sep 2024 13:46:04 +0000 (+0800) Subject: ASoC: codecs: fix the right check and simplify code X-Git-Tag: v6.12-rc1~169^2~1^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=130eb72d3cb38a629205a2a192800b4b1b9bc5c9;p=thirdparty%2Fkernel%2Flinux.git ASoC: codecs: fix the right check and simplify code In the file drivers/base/platform.c, the return description of platform_get_irq is 'non-zero IRQ number on success, negative error number on failure.', so the check is wrong, fix it. And when get irq failed, the function platform_get_irq logs an error message. Fixes: 5e2404493f9f ("ASoC: codecs: add MT6357 support") Signed-off-by: Tang Bin Link: https://patch.msgid.link/20240908134604.3652-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c index df6dd8c5bbe5e..4ec86b71dd889 100644 --- a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c +++ b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c @@ -2155,11 +2155,11 @@ static int mt8365_afe_pcm_dev_probe(struct platform_device *pdev) for (i = 0; i < afe->irqs_size; i++) afe->irqs[i].irq_data = &irq_data[i]; - irq_id = platform_get_irq(pdev, 0); - if (!irq_id) { - dev_err_probe(afe->dev, irq_id, "np %s no irq\n", afe->dev->of_node->name); - return -ENXIO; - } + ret = platform_get_irq(pdev, 0); + if (ret < 0) + return ret; + + irq_id = ret; ret = devm_request_irq(afe->dev, irq_id, mt8365_afe_irq_handler, 0, "Afe_ISR_Handle", (void *)afe); if (ret)