2017-11-19 01:54:18

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/5 v2] 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 <[email protected]>
---
changes in v2 :
irq was unsigned. so changed it to signed.

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..b86b83b 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;

ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,
IRQF_TRIGGER_HIGH, pdev->name, info);
--
2.7.4


From 1584369524800906590@xxx Sat Nov 18 02:35:23 +0000 2017
X-GM-THRID: 1584369524800906590
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-11-19 01:56:30

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/5 v2] ASoC: nuc900: 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 <[email protected]>
---
changes in v2 :
nuc900_audio->irq_num is unsigned. so handle through signed variable.

sound/soc/nuc900/nuc900-ac97.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c
index b6615af..71fce7c 100644
--- a/sound/soc/nuc900/nuc900-ac97.c
+++ b/sound/soc/nuc900/nuc900-ac97.c
@@ -345,11 +345,10 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
goto out;
}

- nuc900_audio->irq_num = platform_get_irq(pdev, 0);
- if (!nuc900_audio->irq_num) {
- ret = -EBUSY;
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
goto out;
- }
+ nuc900_audio->irq_num = ret;

nuc900_ac97_data = nuc900_audio;

--
2.7.4


From 1584369618743330980@xxx Sat Nov 18 02:36:53 +0000 2017
X-GM-THRID: 1584369618743330980
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 01:54:51

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/5 v2] ASoC: mt8173: 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 <[email protected]>
---
chnages in v2 :
irq_id was unsigned. so changed it to signed.

sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
index 8a643a3..11f5f2a 100644
--- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
+++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
@@ -1083,7 +1083,7 @@ static int mt8173_afe_init_audio_clk(struct mtk_base_afe *afe)
static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
{
int ret, i;
- unsigned int irq_id;
+ int irq_id;
struct mtk_base_afe *afe;
struct mt8173_afe_private *afe_priv;
struct resource *res;
@@ -1105,9 +1105,9 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
afe->dev = &pdev->dev;

irq_id = platform_get_irq(pdev, 0);
- if (!irq_id) {
+ if (irq_id < 0) {
dev_err(afe->dev, "np %s no irq\n", afe->dev->of_node->name);
- return -ENXIO;
+ return irq_id;
}
ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler,
0, "Afe_ISR_Handle", (void *)afe);
--
2.7.4


From 1584377519151698875@xxx Sat Nov 18 04:42:27 +0000 2017
X-GM-THRID: 1584377519151698875
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread