From patchwork Sat Nov 18 05:27:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064367 Return-Path: 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 C7DAF60352 for ; Sat, 18 Nov 2017 05:33:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2BB12ACEC for ; Sat, 18 Nov 2017 05:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A709A2ACEF; Sat, 18 Nov 2017 05:33:56 +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 469342ACEC for ; Sat, 18 Nov 2017 05:33:55 +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=m7TcqGloZrRlTLiuwlTJs3qh5d5OrH2P4p/HdekcbRA=; b=EHIWVENL/cX0oXFG3PKN6xfmw2 Av4tfLJIgqga1OHD7ONes7cDxpmUquPB3receqJJvaPZ6jMEtApRbpzWwllM1GdbbGqbtHfBilKym L+LSor95LfaZlRC9eKdO5dvLzKLBfZlp4/4YFxpcjMWUdgWywksWV3pwEYiCGnqNuF63JmuOrqRb4 r2ShvrkBOPLfwCKP8lX9G9sIdX5p2fUW1wVWWZ5+k1VnejpAWehrXdnU9UBcTDK80NnLV6uFSuAGP RZs+a3XjdSP6sQhB4xpa1TBRE/KqirQCKoayi40N8CK3+yY6JyMDlu0996F1xyWc/OXp0cbg3leUw q4yBPVCA==; 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 1eFvlI-0008Gr-Jv; Sat, 18 Nov 2017 05:33:52 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFvgA-0003wM-IG; Sat, 18 Nov 2017 05:28:36 +0000 Received: by mail-pg0-x241.google.com with SMTP id p9so3473842pgc.8; Fri, 17 Nov 2017 21:28:13 -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=5+vWubTMkU4pzUJQ8sV7sz7wTwZxFRIhxjyz6m/Ye+Q=; b=qwP3pVU/YwePSSo1QujOZQ7VeSuSPLBnyChwCUIeTtuSqxNgAlG2exb4AIv0QqU9or zMmiLSuNWWqMJs+div56XmrdsyFM4ymb70xYuyvlliDFsFw2TwRF4PS+wYObYWxqsYyV Ot2EH14P2fRCImwZJOZXjCCtHIWplKHfvdCQl832KnhZZh0XLAZivpoOmY3yO0sxB79j X2p6MuDCTbR/4Y17grRBEiO683YKE3bbiL7Z418jadt39JKLqntYqPEgq29LL8QHwuaw /gy8KLXBAgAlsiNN2nZ4uLhrXJ93dxiixNxSjGNUDbGNtuOS1B1rOgRLnNl475L9xM3w i1lg== 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=5+vWubTMkU4pzUJQ8sV7sz7wTwZxFRIhxjyz6m/Ye+Q=; b=Hyy6L5Tt3pzWdTsOUUaPQTbYy67tTibfWYSZSDei2hgRASGV+BRbA1oOuW3C85D1SU 9V6gKH1IcfNw0ScTAcmlZXMtvLPwsOd6Rp/esSmY+aAUW5xj2vtXHShnLS+jXLRVK9WQ 84pWpiNe4qziDtFJCj8ULyyxFkZwn4n4Lh/V5z7jyW3PT4xr3bCgxfY+E+PU/A6ACG/J Va47uyKt3BWWihsoSqXyjyxBOehytDwgeHtRhvh9tO6bw5IKXCoMbauvWcHLQ7ox8ZRr ceQSF8Q0NYmuE2tQDcml9plr2ovNjMTQvdL8Lmu2lHeKNKW7fboejsihyY5cm9dAUbgM wq7w== X-Gm-Message-State: AJaThX7cJr8V3yxmFnl+Jyt5Fudcv1OfBMGffnnbsGkWQke0Mly/dRlW srtHcGQybGjeq8Et+Q1BDCYlsDZ7 X-Google-Smtp-Source: AGs4zMbsxelgTUU/3ItkamgMAVRSILhoafTWgMhkS1C2mnGPSyY28/6N6Q8x8mnpb08Y8ATWKZ6T+Q== X-Received: by 10.98.190.6 with SMTP id l6mr4425225pff.53.1510982893405; Fri, 17 Nov 2017 21:28:13 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id d15sm10559781pfj.163.2017.11.17.21.28.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 21:28:12 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/5 v2] ASoC: nuc900: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 10:57:53 +0530 Message-Id: <19f8c64a4720118a6d6c4fedd5f8defa6938d1db.1510982440.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <874375c0dca41790e47b60ce30f88ab353f97b38.1510982440.git.arvind.yadav.cs@gmail.com> References: <874375c0dca41790e47b60ce30f88ab353f97b38.1510982440.git.arvind.yadav.cs@gmail.com> In-Reply-To: <874375c0dca41790e47b60ce30f88ab353f97b38.1510982440.git.arvind.yadav.cs@gmail.com> References: <874375c0dca41790e47b60ce30f88ab353f97b38.1510982440.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171117_212834_691117_226C4CA4 X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 : nuc900_audio->irq_num is unsigned. so handle through signed variable. 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;