Skip to content

Commit 130eb72

Browse files
Tang Binbroonie
authored andcommitted
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: 5e24044 ("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>
1 parent 876dec0 commit 130eb72

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

sound/soc/mediatek/mt8365/mt8365-afe-pcm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,11 +2155,11 @@ static int mt8365_afe_pcm_dev_probe(struct platform_device *pdev)
21552155
for (i = 0; i < afe->irqs_size; i++)
21562156
afe->irqs[i].irq_data = &irq_data[i];
21572157

2158-
irq_id = platform_get_irq(pdev, 0);
2159-
if (!irq_id) {
2160-
dev_err_probe(afe->dev, irq_id, "np %s no irq\n", afe->dev->of_node->name);
2161-
return -ENXIO;
2162-
}
2158+
ret = platform_get_irq(pdev, 0);
2159+
if (ret < 0)
2160+
return ret;
2161+
2162+
irq_id = ret;
21632163
ret = devm_request_irq(afe->dev, irq_id, mt8365_afe_irq_handler,
21642164
0, "Afe_ISR_Handle", (void *)afe);
21652165
if (ret)

0 commit comments

Comments
 (0)