From patchwork Sat Nov 18 05:27:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064351 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 34DF760352 for ; Sat, 18 Nov 2017 05:28:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2831F2ACC9 for ; Sat, 18 Nov 2017 05:28:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CC542ACD1; Sat, 18 Nov 2017 05:28:37 +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 A05CE2ACC9 for ; Sat, 18 Nov 2017 05:28:36 +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=WcJeXWqNo01aTy1RBkGd2ODJYHfs7oyErF1H7ZQpTJg=; b=M16 stzwB74aW6FXFeXJ0vY/bFjlzGGjq+fLqpr6qJUx9ymLP9G9VHAgg2DlXmtoceR+G1aqsX0oyp0q3 4UqSHV0DWS/epdl1uZXbP7y+QmATYOXpAIkiO/8Z1TCvvajj0Kb5P/uDfZuBT/3VDrvQpVN0RLB/l qcQGnCsdpYeVTZUsb4eMCHrl9ND0WPriyJJkUWWwpEmMGU963srV6Nu9gjo/YvL3Zd/aC4U/udwno 7lsWR2DL/u+fqYXG/5N1WJxZuTLvvFbAythtNNIKKRS8+F3wcmEmvYzDs0NsZ5KZJntE+IgqLZrsJ yLBamsXqxpobqr22DtmkaqyxhsPeAxQ==; 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 1eFvg8-0003xf-Nt; Sat, 18 Nov 2017 05:28:32 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFvg4-0003vh-Oj; Sat, 18 Nov 2017 05:28:30 +0000 Received: by mail-pg0-x243.google.com with SMTP id p9so3473685pgc.8; Fri, 17 Nov 2017 21:28:07 -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=6st5pH480NgdUa7vSLK9Qitn2Bv9JG11mk505bf5eKM=; b=O2q0DPpur30JF7nEHQm4DmLlD/N7a5uYnYZpCItzfrFFaFTocGiJAmZ1prkHnmCaDd 4i5qwYp1GSLcbrNVq0cHxsj9dgRxwKj/Ct28bhS7EnawiNjh+aH38bYS0lLKUv51bgzm b1nYXNXYp3nqmj21gDMRuSF95eFikZRw8vpNaGzxIX2aoY9r4mlnIf72E225hkTIYXSZ Gm8lGfcU3QByDl+EDbgP7l2152h+7tg+91sCS3M8YNsZF10LFDa4gNvty/hnyoN0AQYk D0NozXAtVmUFd5B3jO79AzeXKrQi82b0sHoOWlDucWeAcKgMnfX61aSeMj32pWWeqvhM sF8w== 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=6st5pH480NgdUa7vSLK9Qitn2Bv9JG11mk505bf5eKM=; b=Y0/VudRWTNZlS4UDA6PkfKTGs/MknI1F/ni0KJuymcWFSLcynXcKjIogRljXXoA9Da fFX/jD/4Mq9NJQUSL70sMsHRXk3jR4Fr57PqdIb4/Oh2TBVF+pwvX3+KaKqPNoVECVUI cXMxJ8PFKiatTS7lAR3JU9dXsQT2gk9r0TFBFY04Z5+xYjX9VekqnDwXBgtxYjyUxjE/ AyE27vohPq5js9vQJBFYNePtFqb39v3kIbB3We2MfFTdghNX5osp9GB2ajVtMNqatDFb GY/cIiS35UsxhmQFHOuh0RLccYbTcCDeh11hp1J9vo2tZSmwBE5avmvi6TrWhmLy0wMY UZKA== X-Gm-Message-State: AJaThX7jZw8vqbiGBxjHk+zq8BPOit047JK1nd42AcSnZEDxj2CPFAK7 i7htEVvZYcL8359TEDpSswc= X-Google-Smtp-Source: AGs4zMZ3McmnHPU+tCA880o05Xp6H7PGjhWIGCLuLsxOuWr+gBxqVDKovcJx2WcXKaggpJ15i2fKeQ== X-Received: by 10.101.82.129 with SMTP id y1mr7301483pgp.137.1510982886843; Fri, 17 Nov 2017 21:28:06 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id d15sm10559781pfj.163.2017.11.17.21.28.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 21:28:05 -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 1/5 v2] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 10:57:51 +0530 Message-Id: <874375c0dca41790e47b60ce30f88ab353f97b38.1510982440.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-20171117_212828_841656_D73EB1AD X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. 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. sound/soc/cirrus/ep93xx-ac97.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index bbf7a92..b86b83b 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,8 +378,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) return PTR_ERR(info->regs); irq = platform_get_irq(pdev, 0); - if (!irq) - return -ENODEV; + if (irq < 0) + return irq; ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt, IRQF_TRIGGER_HIGH, pdev->name, info);