linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: mediatek: mt6359: fix platform_get_irq error checking
@ 2022-09-09  6:45 Yu Zhe
  2022-09-09 21:26 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Yu Zhe @ 2022-09-09  6:45 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, matthias.bgg
  Cc: alsa-devel, linux-arm-kernel, linux-mediatek, linux-kernel,
	liqiong, Yu Zhe

The platform_get_irq() function returns negative error codes on error,
fix the checking.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
---
 sound/soc/codecs/mt6359-accdet.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c
index c190628e2905..b70aac5075ad 100644
--- a/sound/soc/codecs/mt6359-accdet.c
+++ b/sound/soc/codecs/mt6359-accdet.c
@@ -965,7 +965,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
 	mutex_init(&priv->res_lock);
 
 	priv->accdet_irq = platform_get_irq(pdev, 0);
-	if (priv->accdet_irq) {
+	if (priv->accdet_irq > 0) {
 		ret = devm_request_threaded_irq(&pdev->dev, priv->accdet_irq,
 						NULL, mt6359_accdet_irq,
 						IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
@@ -979,7 +979,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
 
 	if (priv->caps & ACCDET_PMIC_EINT0) {
 		priv->accdet_eint0 = platform_get_irq(pdev, 1);
-		if (priv->accdet_eint0) {
+		if (priv->accdet_eint0 > 0) {
 			ret = devm_request_threaded_irq(&pdev->dev,
 							priv->accdet_eint0,
 							NULL, mt6359_accdet_irq,
@@ -994,7 +994,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
 		}
 	} else if (priv->caps & ACCDET_PMIC_EINT1) {
 		priv->accdet_eint1 = platform_get_irq(pdev, 2);
-		if (priv->accdet_eint1) {
+		if (priv->accdet_eint1 > 0) {
 			ret = devm_request_threaded_irq(&pdev->dev,
 							priv->accdet_eint1,
 							NULL, mt6359_accdet_irq,
-- 
2.11.0


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

* Re: [PATCH] ASoC: mediatek: mt6359: fix platform_get_irq error checking
  2022-09-09  6:45 [PATCH] ASoC: mediatek: mt6359: fix platform_get_irq error checking Yu Zhe
@ 2022-09-09 21:26 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-09-09 21:26 UTC (permalink / raw)
  To: Yu Zhe
  Cc: lgirdwood, perex, tiwai, matthias.bgg, alsa-devel,
	linux-arm-kernel, linux-mediatek, linux-kernel, liqiong

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

On Fri, Sep 09, 2022 at 02:45:11PM +0800, Yu Zhe wrote:
> The platform_get_irq() function returns negative error codes on error,
> fix the checking.

This doesn't apply against current code, please check and resend.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2022-09-09 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09  6:45 [PATCH] ASoC: mediatek: mt6359: fix platform_get_irq error checking Yu Zhe
2022-09-09 21:26 ` 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).