summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorTang Bin <tangbin@cmss.chinamobile.com>2024-09-08 15:46:04 +0200
committerMark Brown <broonie@kernel.org>2024-09-09 19:26:47 +0200
commit130eb72d3cb38a629205a2a192800b4b1b9bc5c9 (patch)
tree7ead746b5d2ac572b47a16b0395b765a33187215 /sound/soc
parentASoC: mediatek: mt8365: remove unused mt8365_i2s_hd_str (diff)
downloadlinux-130eb72d3cb38a629205a2a192800b4b1b9bc5c9.tar.xz
linux-130eb72d3cb38a629205a2a192800b4b1b9bc5c9.zip
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 <tangbin@cmss.chinamobile.com> Link: https://patch.msgid.link/20240908134604.3652-1-tangbin@cmss.chinamobile.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/mediatek/mt8365/mt8365-afe-pcm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
index df6dd8c5bbe5..4ec86b71dd88 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)