diff mbox

ASoC: fsl_ssi: Fix irq error check

Message ID 1420667140-32744-1-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted
Commit 64aa5f5843ab12455f6984928058a267f385a82c
Headers show

Commit Message

Fabio Estevam Jan. 7, 2015, 9:45 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

Commit 2ffa531078037a0 ("ASoC: fsl_ssi: Fix module unbound") changed the way to 
retrieve the irq number from irq_of_parse_and_map() to platform_get_irq(), but
missed to updated the irq error check accordingly.

We should test for negative irq number and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/fsl_ssi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mark Brown Jan. 8, 2015, 6:17 p.m. UTC | #1
On Wed, Jan 07, 2015 at 07:45:40PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Commit 2ffa531078037a0 ("ASoC: fsl_ssi: Fix module unbound") changed the way to 
> retrieve the irq number from irq_of_parse_and_map() to platform_get_irq(), but
> missed to updated the irq error check accordingly.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index a65f17d..059496e 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1362,9 +1362,9 @@  static int fsl_ssi_probe(struct platform_device *pdev)
 	}
 
 	ssi_private->irq = platform_get_irq(pdev, 0);
-	if (!ssi_private->irq) {
+	if (ssi_private->irq < 0) {
 		dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
-		return -ENXIO;
+		return ssi_private->irq;
 	}
 
 	/* Are the RX and the TX clocks locked? */