From patchwork Sat Nov 18 09:56:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064681 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 82BD66023A for ; Sat, 18 Nov 2017 09:57:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7200B2A895 for ; Sat, 18 Nov 2017 09:57:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6434E2A89D; Sat, 18 Nov 2017 09:57:41 +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 0028C2A895 for ; Sat, 18 Nov 2017 09:57:40 +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=BLsMAZ1QQeUxcdhnJYvgVQrvzdCgC1aLjyDqYDE62Mk=; b=S2+ n/iQlWcAnkbtU7x8DHXMH62tyze5o/p8CMXGsXiZwsS2RdM5hVIKskroPLbnzvRXksRPHK72niis7 GjhBDQDixkJWR9RTghskEH5jeRNr5gJjgLNAmc+5ZTzrC4jk7G5P8qkZb+FhZV9a69zwa2YTG/stl wc3Q7tjBMAFbRE85Lqt9zENtkSMB8BisSaqqdM6LzLnm3Vpk8+Z6Pyo46CxXDWrrjMGGcERhkQAfm b9nwp9KihLf5nijOuMb7hdvgIpKPTI92rHthEKq94dWlGg1Fl+QtHszsQhzSjpn5JMgfFohSiKru8 hSFDXNnKLxNVPgF7m1Qs0m1fzC45UEg==; 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 1eFzsZ-0002tE-SX; Sat, 18 Nov 2017 09:57:39 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFzsG-0002ci-AA; Sat, 18 Nov 2017 09:57:21 +0000 Received: by mail-pf0-x242.google.com with SMTP id n89so3750334pfk.11; Sat, 18 Nov 2017 01:56:59 -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=0b4kJDBKvMkp8TzZ7AgmwSwWNqmH1ri+4ay2iE+vdLs=; b=nKERgMtRTdwe35gRO/d4SmfNbDbmD43B+AZAm6gPnKvKY3xeq6zwRkia73eHJA0/nd Svi5M/Gykm83H7qQYeN/z/+HB7POesz31HcqJg65XtZx0rwLZB+w30BhZ1a2WBTnLdh0 ovNVI2JhG3g1nKXKt+9wf/DWX1mjb89yC8qZIHUSM6+dRwT9lATgXrqi9vTK1c4vWYTH q7Ik+oEXlL+aCr0DEou03KhcVFzj5aUZghGf+KKTJBdX1rZwXmmccZK5yq3ASaQn8m8Q TzBYM4FsF27QKQwv3oQAMOO1FcezjyySMuEDVwQECWq7UH2w9BbPL1Ehb8SMxJUiPME3 JOlA== 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=0b4kJDBKvMkp8TzZ7AgmwSwWNqmH1ri+4ay2iE+vdLs=; b=hYa9etqRIZc/McMwr9vMOJEW2/X6yzt3nc3IiIfu4RssTcTOKt53ioGhlVJC2n55u3 9yBuWZii6qUV+tdGiEl8fWEfwpv5ud3XtNwILRLCsV7poVKg0FFQT9mbRXOO0Agd2crF JmZSjVqXZbmeKBwrdoNPt+KH9CBgKeQvbG4E18LYeWya2PhjOcQr+CujCLnvF4k4WmQu Q9mflys9OKzlLoaELttLuDNFo3hwcU5+tWX73KRg0t2JFnqVrGZkGECXT3gCUC1zXQJD 1aqGF+SEcBcX1sglfwfE3kqTYINjPIipSX1r0xE+BFSb7NmcjbNDXwwbFneFiaUXiU96 Fwvg== X-Gm-Message-State: AJaThX4bZDah1Xo6pO7eyxhtb0AXZzVEfq6cXndDLh9ZfkwcUQtxMB46 TpzzXNFyvhxPtPrjDjDbnm8= X-Google-Smtp-Source: AGs4zMZFcdQ86gmOezZhUQlr9EvXs4Ns+RY/4vTUgRXrb617hNqbio4a+zhCin58iukNBcc5J8mf9A== X-Received: by 10.159.252.198 with SMTP id o6mr7834449pls.390.1510999019442; Sat, 18 Nov 2017 01:56:59 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id r16sm8862577pgt.72.2017.11.18.01.56.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:56:58 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com, linux@armlinux.org.uk Subject: [PATCH 1/3 v3] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 15:26:45 +0530 Message-Id: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.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_015720_411918_854F0E58 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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. 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);