From patchwork Sun Nov 19 04:15:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064999 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 82931602B7 for ; Sun, 19 Nov 2017 04:16:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66EBF2952A for ; Sun, 19 Nov 2017 04:16:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BBC429530; Sun, 19 Nov 2017 04:16:25 +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 E31B62952A for ; Sun, 19 Nov 2017 04:16:23 +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: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:In-Reply-To: References:List-Owner; bh=ArGHkh7Q4KscmSdJXkCl6y1xnkOfJW59VnZvqMDSvok=; b=chU EsYDFvZ4mjktT8ukDGG79sVfucgGmFUNVV5hXUnIGeVNSr2GNf4ZaBTVk/tIJNRkSM98VXcV3gb++ YCHUST2TIk9T1d6gikPufnwum5iB8RedkunYMgXF3FXyKV6bWLr2lJ/s2vDiyme2ESe6cYZS+Oi9H 6Lm+Jy69K86g2xlLmH9Se3zzHFxgIKTxo1xLuJ+3aPYdG6dZWj8r7fceVOWoXh0uy9ZVb4h3nhDH+ t6NttMymnebeCnFwqScEK3bxrtvOA8ZfpeUgt9bD3D2sKt+kBrf2n+pRV3MPXOPYGn/+4I4QnXA33 H1xz1dx6KtbwLKHw5VtRg/OBjCcvMbw==; 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 1eGH1d-00084g-FT; Sun, 19 Nov 2017 04:16:09 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eGH1E-00079q-CX; Sun, 19 Nov 2017 04:15:45 +0000 Received: by mail-pg0-x244.google.com with SMTP id s75so4858051pgs.0; Sat, 18 Nov 2017 20:15:23 -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; bh=PzR0YkvWzGulCveSsWb01QYbwx3jF3+syszDfy3VDcM=; b=ZQVxym/FYJf9nVeYcJiKdRT6J/7CZOhwuLSiiBmJrWGNzQEnW8FnikF6ixZfZthwd3 VsoihPDQ1Y6Su7dlJZ5UOkkdRZGlgBGkLVbun+VJrZHzleNQDYFwHZQswoIt1ya88GRn Kv1me5PPmDj5sw/sIWfYgDN3egM8yjKxMS0/g5J3CkIY30gPmReSY2PA9a7o8JdxHC+B lvG1ecF5bir9+UWnH8zDRCsEONcTUI6j354EWxMO2AVKWFut5TuvQV/KT9voS1SPEWhy 9RIMo9yB2rV2gHcpTAwD0APtWxRfvGx5tsIwPhZ+saAvkFiZrFuyJNN8DlC3ThgBci1d PTbQ== 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; bh=PzR0YkvWzGulCveSsWb01QYbwx3jF3+syszDfy3VDcM=; b=VAzJSRRNQFb2LMVmeH2txZ6ZbiQeFZOlsbVIUTVX2uWIJY7DfIJtDoPiBW9P2z2Cdh ubcV+8m4YCe17G4SidrXDm7/TTWNRFW8fwVWs9w8PFpimZFa+P6QetZ5OPHN5xXEn7Gz yjv/dUr69OkqlTKuUWOzQnBTj6y8+SezyQPHcY7exIZmbIdVpIN/x0CuMnv2eKnJyuwi Ij61TWkS1nLZIVR4uwl50Kw3Vx9DhlU2aGHeAZB96qftIuima9LkvkiMyTEdwE3kEmjv 4nH4GpDBv0qF2DHqfXHf5hLVBQd3CW03ivicdsYU6R8ZbhUvWR67PFNq9/8W3TeG64OL e3Dw== X-Gm-Message-State: AJaThX711+F86zFveIf9IFCN+rrkOzgI76NuyEF9l86aSJsiE1ihQMMi UdE3CRvjgJHveyhU20y9QtE= X-Google-Smtp-Source: AGs4zMaJ+CmePO+J/Cz5c6OrM9456zKPUL+YcCrX2vgIF7w945TR5jCgTfjxkw4c6Is9DULTF75l6Q== X-Received: by 10.101.92.8 with SMTP id u8mr9542159pgr.93.1511064922801; Sat, 18 Nov 2017 20:15:22 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id l14sm12741475pgn.35.2017.11.18.20.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:15:21 -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, linux@armlinux.org.uk Subject: [PATCH 1/5 v4] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 09:45:00 +0530 Message-Id: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_201544_462118_18823ACB X-CRM114-Status: GOOD ( 10.51 ) 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 : irq was unsigned. so changed it to signed. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. changes in v4 : Return -ENODEV insted of irq. sound/soc/cirrus/ep93xx-ac97.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index bbf7a92..efeecee 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -365,7 +365,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) { struct ep93xx_ac97_info *info; struct resource *res; - unsigned int irq; + int irq; int ret; info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); @@ -378,7 +378,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) return PTR_ERR(info->regs); irq = platform_get_irq(pdev, 0); - if (!irq) + if (irq <= 0) return -ENODEV; ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,