public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: atom: Remove redundant check to simplify the code
@ 2021-11-25  7:50 Tang Bin
  2021-11-29 16:22 ` Pierre-Louis Bossart
  2021-11-30  9:46 ` Andy Shevchenko
  0 siblings, 2 replies; 8+ messages in thread
From: Tang Bin @ 2021-11-25  7:50 UTC (permalink / raw)
  To: broonie, cezary.rojewski, pierre-louis.bossart, liam.r.girdwood,
	yang.jie, perex, tiwai
  Cc: alsa-devel, linux-kernel, Tang Bin

In the function sst_platform_get_resources(), if platform_get_irq()
failed, the return should not be zero, as the example in
platform.c is
  * int irq = platform_get_irq(pdev, 0)
  * if (irq < 0)
  * return irq;
So remove the redundant check to simplify the code.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 sound/soc/intel/atom/sst/sst_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c
index 3be64430c..696d547c5 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -226,8 +226,8 @@ 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 < 0 ? ctx->irq_num : -EIO;
+	if (ctx->irq_num < 0)
+		return ctx->irq_num;
 
 	return 0;
 }
-- 
2.20.1.windows.1




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

end of thread, other threads:[~2022-01-25 18:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-25  7:50 [PATCH] ASoC: Intel: atom: Remove redundant check to simplify the code Tang Bin
2021-11-29 16:22 ` Pierre-Louis Bossart
2021-11-29 17:11   ` Mark Brown
2021-11-29 19:01     ` Andy Shevchenko
2021-11-29 19:05       ` Andy Shevchenko
2021-11-29 19:08       ` Mark Brown
2022-01-25 18:09   ` Andy Shevchenko
2021-11-30  9:46 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox