From patchwork Wed Nov 29 16:17:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10082751 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 7CF936020B for ; Wed, 29 Nov 2017 16:28:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6300229B30 for ; Wed, 29 Nov 2017 16:28:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 580A829B3B; Wed, 29 Nov 2017 16:28: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 1222729B30 for ; Wed, 29 Nov 2017 16:28:41 +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=m0HPvyATxpSfX5iBOOvaIe6HeeUgeRVsPqQT0frMY1I=; b=NmO Yap9Z+cC6EMJrSXfCa6qL7YCM2l5QnyVEsBDLd0fjafEjRL+Ehj/P4+sLEAA/L4Teif68YJA9V1X0 tOEoZ41ZTNKTat2BZ1cfjQwAoz67uMxqV+OnJETWXfnXHw8+9NUU48PSsiaAxDocAJaCveXTk3/NY CZttmADmCb4obaPC+BRK+2PmSJW3aTb53MVtPA1rGKBSExcGHtyPRIHju0EmVFk015t4j/Ob7Ra1j I3QpRgdTnLRmOxLLrRw04GDObKNNbp0dYpr5wWYnwzZVxGm1BxxPPiin/kEfo6t5I7u1xNtnWmBU4 E2TPRS9vNKKOFDPQu791eLlMXRstCgw==; 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 1eK5Dx-0004wv-LT; Wed, 29 Nov 2017 16:28:37 +0000 Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eK53l-0006in-AF; Wed, 29 Nov 2017 16:18:08 +0000 Received: by mail-pl0-x242.google.com with SMTP id d21so2380067pll.1; Wed, 29 Nov 2017 08:17:44 -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=Lk6uZkFuatrIp2wlIGtrMYMBcjW63jZ8nLcFh9jkFuM=; b=Lgk7oHn0Tw9bjkEIp4PZW5rp3zHF7hI/i1cDmz/rSba58K4wExhhqPNHEOhrwns6HH IGegPvf/EkIAarTIYMkUY6IJFf+HAo08gzIU/a0irtg0KbAQ64jsVabkzmUU/KmbvLAh bRdIM7WUSF6MnnH0kzPIlSbxAHSwfk6hZeCNMI4zx7W27Lll/gHgA0rUqVWTRAzoMs6p xwj5awFKfUcU5B8yMOtU2ENik6qy7HOLRL7jSl1z07XUsEEPd568/FxrMTlYa0vcmEHB CaFEI/0C8bVUrtAGw6KsH5lapkVikPDOFiUlWloMljPawmrGr3JMo2d2gU98LvncaBdx QGZg== 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=Lk6uZkFuatrIp2wlIGtrMYMBcjW63jZ8nLcFh9jkFuM=; b=PnG1PZORBbXYsSviYT1p8KaaG4mCz6OTFr6qbqFiDf59FdX+1WSBCFx6i+OWYaEa3j JACfqg21WYovz1x1xn8qndoHJNFylfn8YppDiviUzZNKCzqEyEFP7v4L1P9wm33OysTl xCHFviFj5qFZlcTpoy89XJRID5yw4j6roUN9dcuzR7tt3kNjMQDVSiAJJmww+J3kuGJX vrEz3hk39o3o3XD3g5lARehX4dhgC9XFZqvliCgsGy/YBpe4cD3MgFKjEM+NYw1tiAE3 RpNXKr2vg4tdJsojy7K5q9G+d5Ht2QgKHgyqa7MVPQCIUyyg5TO7f6icpaDe4RucrBCf gNZA== X-Gm-Message-State: AJaThX5mQ5XF6rzMxeUwU/olLF6UVG9ORBs9bnlf5vf5v3yudHM+Km5h CuzMRl5c5oBcpHCl7PV6WnQ= X-Google-Smtp-Source: AGs4zMb9rMltGfrVLPzMAomlvCR9IQTSP5qzXMbatIKp/Uv1Dgp0MSBC7p7khEX/xYSmpGi5spwSzA== X-Received: by 10.159.255.74 with SMTP id u10mr3372924pls.116.1511972264178; Wed, 29 Nov 2017 08:17:44 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id q74sm3867400pfd.134.2017.11.29.08.17.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 08:17:42 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com Subject: [PATCH 1/5 v5] ASoC: ep93xx-ac97: Fix platform_get_irq's error checking Date: Wed, 29 Nov 2017 21:47:10 +0530 Message-Id: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.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-20171129_081805_389704_086D3928 X-CRM114-Status: GOOD ( 10.48 ) 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-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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. changes in v5 : Add separate error for irq == 0 and irq < 0. 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..cd5a939 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 < 0 ? irq : -ENODEV; ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt, IRQF_TRIGGER_HIGH, pdev->name, info);