linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5 v5] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking
@ 2017-11-29 16:17 Arvind Yadav
  2017-11-29 16:17 ` [PATCH 2/5 v5] ASoC: mt8173: " Arvind Yadav
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Arvind Yadav @ 2017-11-29 16:17 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, matthias.bgg
  Cc: linux-kernel, alsa-devel, linux-arm-kernel, linux-mediatek

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>
---
changes in v2 :
               irq was unsigned. so changed it to signed.
changes in v3 :
              Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.
changes in v4 :
              Return -ENODEV insted of irq.
changes in v5 :
              Add separate error for irq == 0 and irq < 0.

 sound/soc/cirrus/ep93xx-ac97.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index bbf7a92..cd5a939 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)
 {
 	struct ep93xx_ac97_info *info;
 	struct resource *res;
-	unsigned int irq;
+	int irq;
 	int ret;
 
 	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -378,8 +378,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
 		return PTR_ERR(info->regs);
 
 	irq = platform_get_irq(pdev, 0);
-	if (!irq)
-		return -ENODEV;
+	if (irq <= 0)
+		return irq < 0 ? irq : -ENODEV;
 
 	ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,
 			       IRQF_TRIGGER_HIGH, pdev->name, info);
-- 
2.7.4

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

end of thread, other threads:[~2017-12-01 13:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-29 16:17 [PATCH 1/5 v5] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking Arvind Yadav
2017-11-29 16:17 ` [PATCH 2/5 v5] ASoC: mt8173: " Arvind Yadav
2017-12-01 13:44   ` Applied "ASoC: mt8173: Fix platform_get_irq's error checking" to the asoc tree Mark Brown
2017-11-29 16:17 ` [PATCH 3/5 v5] ASoC: nuc900: Fix platform_get_irq's error checking Arvind Yadav
2017-12-01 13:44   ` Applied "ASoC: nuc900: Fix platform_get_irq's error checking" to the asoc tree Mark Brown
2017-11-29 16:17 ` [PATCH 4/5 v4] ASoC: intel: sst: Handle return value of platform_get_irq Arvind Yadav
2017-12-01 13:44   ` Applied "ASoC: intel: sst: Handle return value of platform_get_irq" to the asoc tree Mark Brown
2017-11-29 16:17 ` [PATCH 5/5 v4] ASoC: intel: mfld: Handle return value of platform_get_irq Arvind Yadav
2017-12-01 13:43   ` Applied "ASoC: intel: mfld: Handle return value of platform_get_irq" to the asoc tree Mark Brown
2017-12-01 13:44 ` Applied "ASoC: ep93xx-ac97: Fix platform_get_irq's error checking" " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).