Message ID | 0703b0d6d8ba826a42f244eec6bce71514edd563.1511970158.git.arvind.yadav.cs@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7B4566020B for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 29 Nov 2017 16:18:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6658529B1A for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 29 Nov 2017 16:18:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B2EE29B1B; Wed, 29 Nov 2017 16:18:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 13C1129B1C for <patchwork-linux-arm@patchwork.kernel.org>; Wed, 29 Nov 2017 16:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Qnbxb76/kaLIBJrQMaorqzof8d99pMZuiwGtBRp9u3Y=; b=saxKqH73teaNZDBTvX9fFxK6jc y4PeOZDhHHJ/vwvfOfvlTSHmXTZSS3Wp8EAjykolDJyIPfHgHXX7ipJSF0f3Ei6jWhldywfZCpHLS g/Nvqm0Mi1wmfhoi2mZRJshUGITDEuqgUzzaCT1iFL9/yYqJcfrW2GtmFOHoUABcpJ3a3IqbdyhDK U6wVjnenit3/cRxvXwgegA+GSXw1Uh7ZwplVIP0H1EjKXeRMWaykVRX75UVKVVyAs9AfvZJxQc2Ry DIYwW0CDjqmbyK8dFnqYlP+kfndWO1GMKwzmsk2BMPrAsaqBOYJMK6vVWge69xi3GyT5TYXap+p9K W4U6NthQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eK54I-0007Nw-Mm; Wed, 29 Nov 2017 16:18:38 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK53r-0006lN-HV; Wed, 29 Nov 2017 16:18:13 +0000 Received: by mail-pf0-x243.google.com with SMTP id u19so1759216pfa.12; Wed, 29 Nov 2017 08:17:51 -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=/5euh2mLno/aGnVw43dtgHt5f2grqCUp6fMSHHrBK9I=; b=B+wKHr1bri7dbeD7Xm/Knp2itU5LStu/7cced/LxKBZ63xpszGo/iiy53QE4Yj7Nt2 vOVF78gvyXPGSB9JNlulIRiVskjftXAq1HLPVMZ9+FHSt1xHq6DqNX8s1dxRVi8wa4rN XHXiFdCkaHfPQpBhpTs1iJNeb2xjaG+vv0K2wjvP0KPjMUunRGF1kyVvBluhHOJZcHwH EReL/ipM5eRR80n3xXfc1XPyD9sxClFkCTXsM3H2OQqNMLCNX9wdwXbDzjBuFgQHacbk H2Wt9SCHULYWmF0N+NW62xfdf28VG0vEGThoQoxNrJnI+V6CBbhGvzmqpyZQDni+y404 9JZg== 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=/5euh2mLno/aGnVw43dtgHt5f2grqCUp6fMSHHrBK9I=; b=EcV0/cCWJO/xafU3YU5nCrNmzBNdGXiwuoqRgL858mGOJD8Femj6yLMkdaUely54jP VuB59hR8EpDb8rgWU/qQvNbkDHjEgIx8yLZoIJhTMQ/ZYTjL+a1ZjxVrk/Gxkbtc+Z4D +UaJ73zgThaUd3wqAM8lm+b/i6YpF+T1nNPDmXVH4zb2wUpome8SdXGvWHRxrVtTOay3 1bPcYICmResOQ40Ij1zQh/qih3gfUNetAau8tn+trBX5BmMRLmVUQ3mDj73ZDkLfuU+6 U/pDtNU+hezjm/qtdbmjdk2oBX2VUh0rUrNeExNtXb2YITg7V15GEJkm/rMiebw5Njtc K6yQ== X-Gm-Message-State: AJaThX7erUoTFOFaRKIPNimR9a65YMfP0LM4tJQ3clZ01BW2WjDPosZ3 LiQzt29vKGE3A4fL1E9vLcs= X-Google-Smtp-Source: AGs4zMYy3ac9yADftTX26MA+gYnG0HU+zWyKDy7U0M3bwV7xRrcwCoW3bTy6V5lgmGqDtfVxSu8rPg== X-Received: by 10.101.96.35 with SMTP id p3mr3257521pgu.230.1511972271112; Wed, 29 Nov 2017 08:17:51 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id q74sm3867400pfd.134.2017.11.29.08.17.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 08:17:50 -0800 (PST) From: Arvind Yadav <arvind.yadav.cs@gmail.com> To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com Subject: [PATCH 3/5 v5] ASoC: nuc900: Fix platform_get_irq's error checking Date: Wed, 29 Nov 2017 21:47:12 +0530 Message-Id: <0703b0d6d8ba826a42f244eec6bce71514edd563.1511970158.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_081811_669482_6BED9A8E X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index b6615af..5e4fbd2 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 < 0 ? nuc900_audio->irq_num : -EBUSY; goto out; }
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 <arvind.yadav.cs@gmail.com> --- 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. changes in v4 : Return -EBUSY insted of irq. changes in v5 : Add separate error for irq == 0 and irq < 0. sound/soc/nuc900/nuc900-ac97.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)