Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: codecs: fix the right check and simplify code
@ 2024-09-08 13:46 Tang Bin
  2024-09-08 14:36 ` Markus Elfring
  2024-09-09 21:01 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Tang Bin @ 2024-09-08 13:46 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, matthias.bgg,
	angelogioacchino.delregno
  Cc: linux-sound, linux-kernel, linux-arm-kernel, linux-mediatek,
	Tang Bin

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>
---
 sound/soc/mediatek/mt8365/mt8365-afe-pcm.c | 10 +++++-----
 1 file 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 df6dd8c5b..4ec86b71d 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)
-- 
2.33.0




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

end of thread, other threads:[~2024-09-09 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-08 13:46 [PATCH] ASoC: codecs: fix the right check and simplify code Tang Bin
2024-09-08 14:36 ` Markus Elfring
2024-09-09 21:01 ` Mark Brown

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