aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-11-29 11:17:10 -0500
committerMark Brown <broonie@kernel.org>2017-12-01 08:04:51 -0500
commit8d6fb0bce2021baf056344cb0abb2df00c5fe6d5 (patch)
tree95bad22c1484173b8e990af44e7d9e1d7a9bb175
parent4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff)
ASoC: ep93xx-ac97: Fix platform_get_irq's error checking
The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/cirrus/ep93xx-ac97.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index bbf7a9266a99..cd5a939ad608 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -365,7 +365,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
365{ 365{
366 struct ep93xx_ac97_info *info; 366 struct ep93xx_ac97_info *info;
367 struct resource *res; 367 struct resource *res;
368 unsigned int irq; 368 int irq;
369 int ret; 369 int ret;
370 370
371 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); 371 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -378,8 +378,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
378 return PTR_ERR(info->regs); 378 return PTR_ERR(info->regs);
379 379
380 irq = platform_get_irq(pdev, 0); 380 irq = platform_get_irq(pdev, 0);
381 if (!irq) 381 if (irq <= 0)
382 return -ENODEV; 382 return irq < 0 ? irq : -ENODEV;
383 383
384 ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt, 384 ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,
385 IRQF_TRIGGER_HIGH, pdev->name, info); 385 IRQF_TRIGGER_HIGH, pdev->name, info);