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 and and we must check its return value.
Arvind Yadav (5):
[PATCH 1/5] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking
[PATCH 2/5] ASoC: mt8173: Fix platform_get_irq's error checking
[PATCH 3/5] ASoC: nuc900: Fix platform_get_irq's error checking
[PATCH 4/5] ASoC: intel: sst: Handle return value of platform_get_irq
[PATCH 5/5] ASoC: intel: mfld: Handle return value of platform_get_irq
sound/soc/cirrus/ep93xx-ac97.c | 4 ++--
sound/soc/intel/atom/sst/sst_acpi.c | 3 +++
sound/soc/intel/boards/mfld_machine.c | 2 ++
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 4 ++--
sound/soc/nuc900/nuc900-ac97.c | 4 ++--
5 files changed, 11 insertions(+), 6 deletions(-)
--
2.7.4
From 1584464196613990643@xxx Sun Nov 19 03:40:09 +0000 2017
X-GM-THRID: 1580974139634848771
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread
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]>
---
sound/soc/cirrus/ep93xx-ac97.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index bbf7a92..d66c561 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -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 1584465437866513980@xxx Sun Nov 19 03:59:53 +0000 2017
X-GM-THRID: 1584342085865135600
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread
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]>
---
sound/soc/nuc900/nuc900-ac97.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c
index b6615af..383627d 100644
--- a/sound/soc/nuc900/nuc900-ac97.c
+++ b/sound/soc/nuc900/nuc900-ac97.c
@@ -346,8 +346,8 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
}
nuc900_audio->irq_num = platform_get_irq(pdev, 0);
- if (!nuc900_audio->irq_num) {
- ret = -EBUSY;
+ if (nuc900_audio->irq_num < 0) {
+ ret = nuc900_audio->irq_num;
goto out;
}
--
2.7.4
From 1584406791521309701@xxx Sat Nov 18 12:27:43 +0000 2017
X-GM-THRID: 1584406791521309701
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <[email protected]>
---
sound/soc/intel/boards/mfld_machine.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/intel/boards/mfld_machine.c b/sound/soc/intel/boards/mfld_machine.c
index 6f44acf..77b3162 100644
--- a/sound/soc/intel/boards/mfld_machine.c
+++ b/sound/soc/intel/boards/mfld_machine.c
@@ -372,6 +372,8 @@ static int snd_mfld_mc_probe(struct platform_device *pdev)
/* retrive the irq number */
irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
/* audio interrupt base of SRAM location where
* interrupts are stored by System FW */
--
2.7.4
From 1584466746663283064@xxx Sun Nov 19 04:20:41 +0000 2017
X-GM-THRID: 1584466746663283064
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <[email protected]>
---
sound/soc/intel/atom/sst/sst_acpi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 32d6e02..693b970 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -236,6 +236,9 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
/* Find the IRQ */
ctx->irq_num = platform_get_irq(pdev,
ctx->pdata->res_info->acpi_ipc_irq_index);
+ if (ctx->irq_num < 0)
+ return ctx->irq_num;
+
return 0;
}
--
2.7.4
From 1584251312918361689@xxx Thu Nov 16 19:16:27 +0000 2017
X-GM-THRID: 1584112376505130338
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread
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]>
---
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
index 8a643a3..eee27bc 100644
--- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
+++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
@@ -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 1589925072500737727@xxx Thu Jan 18 10:18:26 +0000 2018
X-GM-THRID: 1584611025910997874
X-Gmail-Labels: Inbox,Category Forums,Downloaded_2018-01