Received: by 10.223.164.202 with SMTP id h10csp4566433wrb; Wed, 29 Nov 2017 08:18:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMYj0kp5kse33Jc4qsXIR+A4tbzUyqg0yDMTrEuhulDvtvFq7gcOruouUZnA49sgiym1NfDG X-Received: by 10.84.234.199 with SMTP id i7mr3394808plt.377.1511972339559; Wed, 29 Nov 2017 08:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511972339; cv=none; d=google.com; s=arc-20160816; b=c2UOAZ9Ed6c8Q3WI73DYDcEPBxJLM3nUnSpLGHhJMNP2vEPpD9oP2iURJC7Vc+Rrme dsmSzs0gmYPO4BI6tvdTzKDMrnW0XxZggZjYQfUXhROs8b1GGbK+6x75GeZuZf6Fp64g Rr3sRB/tHGMP+Tm7Rk8gct4bK/cfTHBYxo/5ffB5r8mRnwHWC1dWIVjabmKaJLLvSfGH r2Gb8KFuWe8fZeyer5johzhNGJcOqXyX1O7S4TxmnmCyQwESY9H4Prdzq6yeI6uWUKvt pU0sHT+gP3jIg9317MU+T5NVTXOsBX21tZ41QYK+8KaNNw1nmXHW5HFBWSGEBzLOs0Fs y5Ww== 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=/5euh2mLno/aGnVw43dtgHt5f2grqCUp6fMSHHrBK9I=; b=d0crw5EWaLIqaFimvmcNnZXuxo83/xpHOlW7tj6a+HtXIUs8o/zGjlIjDx5q7mF/SC M7uwgSgNljMXLPOjx+TYr3enP8WLqTR2nY5FpVn0HOkdNpFC1u3njsNaKbqYMP803GbD fd3gpS+kiX/iSGyqGzPjBhnXB+PkslX70yKSXHMmuQxt5YER7di9x3SAW+VuqTCFjCUO 4P6ZQhASlDh18Q69qgzjQGXywqDMrf+FhkAGbthxANr8jKd7cKc+uHAkawTF9I8ozorq ftjxX13NcZrZfgkabQkTwjBE+2nttnuC9GijGOL/UHwAEizS9xEEGsWfqAGnncr17HlX f1tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B+wKHr1b; 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 c1si1459069pgp.582.2017.11.29.08.18.47; Wed, 29 Nov 2017 08:18:59 -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=B+wKHr1b; 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 S933596AbdK2QR7 (ORCPT + 69 others); Wed, 29 Nov 2017 11:17:59 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35163 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbdK2QRv (ORCPT ); Wed, 29 Nov 2017 11:17:51 -0500 Received: by mail-pf0-f193.google.com with SMTP id j124so1771042pfc.2 for ; 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=tLtVWGggmCRVSNVUlcTn2AYwUcvB03BeY+6Vj1bvRNJfilfuClp47I/cdX9pthk/v6 d5bd9FhN9eBcArg9ja8Ijp3w8zkGJtmwaeqtV+CJW8HspUEKji9qGe2YF+n2Yg4d/7lZ 8FOAqVDWXv3V6wHlREE8QKTzKdX18CzDMlDyV8xcnbH/UPv4VzS+yDKO9/DzZLt0ZwBe 43+bJfPR6IG47x+qV4XXzm7BOWJh7b0KmMmZPu0Yqubg9bL5FpGijT892AgyyPZLOdp/ g7k+Vr6X1ht+ArlAJr4AllOe8Pwm62s+LEJY2/labgwMl9Vsws22SPbg6VvO+4Blubnu uLdg== X-Gm-Message-State: AJaThX5ir8ElWwyS9U6KgR00YGq45xpDMHlxglz0i/3RrreiULTyMk1X hkIxxFXRZIjQi2jYNtfyN54= 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 To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com 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/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> 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. 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(-) 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; } -- 2.7.4 From 1585403464329849991@xxx Wed Nov 29 12:29:25 +0000 2017 X-GM-THRID: 1585403464329849991 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread