Received: by 10.223.164.202 with SMTP id h10csp2350289wrb; Sat, 18 Nov 2017 19:57:26 -0800 (PST) X-Google-Smtp-Source: AGs4zMb73JU2md9QbFnXvupUXJ3rUxjidenhfmX5hdqc17fEojQI5RzHoQdNCk9Rfoe+xz+JoUpB X-Received: by 10.84.143.195 with SMTP id 61mr9912031plz.277.1511063846327; Sat, 18 Nov 2017 19:57:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511063846; cv=none; d=google.com; s=arc-20160816; b=qdZbMeZEmDZiYzXIwMe2F/Zkbjmy82vryj02NYx3fnHBAWEMIZPF+LsL28tbyCdJDk 7hkTSSQ3//j7ZJAv/gxNnVXKw9X/qgsk/+JgQokHYiff1bHU3/0IzBbdzqphfPhdhgbZ J5rFb4n9pq4vymcs8bdxWUnJ1LHeabpt5yYlL9DcGRpDfu4JAXhwDSqfAZfMh/G01JOk o3tVpbIBow1EWNyuFtbIKBa8VfLdBlSOyCApQpdE0Rmm19Dmq66+PBIeBQd8Me4ZeCdE Y7URkw2DwJZcsYEDAdJPiomDQ36bymV7zaoH8mivHJ4RHOOeLsH2iO+ly7mGnxBxre5I tpog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=wmra2QTGmAOddIpAWmSYeAc5m2iInXMIWfeyNphXS40=; b=zlFFuodnZFw2RbbwCalLh6qOo2qTjMiAl4GgofZekUpQBDwN0FVG280PfRz5Wv1yqZ 2Y4bNnFDsisku5VuNPlJsmc95sq3yRD8lEjUrGfyYFLw29gRf4p/M7GXjBay8P3j5eGb n7/veqruzH+3ORk1IROVm6mZA1UzUzlcAULXzivydw5neI7o9f2I6REcZNXlE+QeheS8 rgWM6VJ7MeGo2QqwAivStd5yc0hr/yYBUviq5t2S1PDqc4QilVYFAPOTBkUDyY4QYFEq lJxM9DwTkfOaQvQkyb3Lj4lbcvj1L8K5igy4ClEiQAy7S7LkC4KUzD4YDvDks9zr+JcG Z5LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NMJPBJXF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si5477732pgc.21.2017.11.18.19.57.13; Sat, 18 Nov 2017 19:57:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NMJPBJXF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163448AbdKRJ51 (ORCPT + 93 others); Sat, 18 Nov 2017 04:57:27 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:39476 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163383AbdKRJ5H (ORCPT ); Sat, 18 Nov 2017 04:57:07 -0500 Received: by mail-pg0-f68.google.com with SMTP id 70so3776488pgf.6 for ; Sat, 18 Nov 2017 01:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=wmra2QTGmAOddIpAWmSYeAc5m2iInXMIWfeyNphXS40=; b=NMJPBJXF096Q0wPole5dzBYviUV8RWeIMe3jWVZa0+NAb+n/UeWau5BAVNlkAEjt0u w0xj66RFUdIfD7BCxmAGb79pRWuupagbkwcbW7s3Khue1qkHVJDk8vz2PGzHxmPsowm0 /vGmoNYngYcwnIrBDMBFNOyEkg00xKB3Sr6mzk8dce+VjaPRjcfdzfFM5crECHng/jhh JT2RzBsWYaRnEmh6k6C6qPVKaFiEmDGhalwOCCxUw86/myHUpGFp5RU2bQCbKnIEJQKv OWXrM67Lh3FU3z2FGhbjKf9GL2eixXvhaVbq/70T9bom9zOsfGGidwMoGywhFmri3wAc f7gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=wmra2QTGmAOddIpAWmSYeAc5m2iInXMIWfeyNphXS40=; b=kHvtO8S5QYtCTqST6wwAWPd1ZWoUBpEmSQkfvyLfhKZb0vHPaMMhXRlWCQ9SCQ4l5C YAIWZ7FR3HAMpv9yje9lxUdK+oAHttjtI/wkUU1K0kJhEQEt/GaO0nLuUk6Odnnuj9bK WoB1QrsvCHa163dGoMaXloP2vZlasHJmy5lwOqs0F8Gaepw73aOQrRt/xHRKOOkAL2sy wtQQxuFq90Byd7NIc/lMiHGhumIBJTD3Htu2p6gA/rr1XCeMZ/f9MJS42Qyqr9HkW7CN 7inj2dATiHUfxQ0h4JV4BVlL7jForlMVknFMEj0t4fejJRWg/IbX4IjdLlHXvdsk73EC hN+g== X-Gm-Message-State: AJaThX6OfezaA5EoJ23YCn87dcrmsuDyqGkyONYvAOhED3DaCPjbQ5ES 1bNbpU2HDVjANQ/wd6gCaS8= X-Received: by 10.84.240.73 with SMTP id h9mr7974758plt.388.1510999026616; Sat, 18 Nov 2017 01:57:06 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id r16sm8862577pgt.72.2017.11.18.01.57.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:57:05 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, linux@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/3 v3] ASoC: nuc900: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 15:26:47 +0530 Message-Id: <19f8c64a4720118a6d6c4fedd5f8defa6938d1db.1510997840.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> References: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> In-Reply-To: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> References: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- changes in v2 : irq was unsigned. so using signed variable ret. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. 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 1584466099740665390@xxx Sun Nov 19 04:10:24 +0000 2017 X-GM-THRID: 1584347274609570954 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread