From patchwork Sat Nov 18 05:27:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064361 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 33DA460352 for ; Sat, 18 Nov 2017 05:29:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 279D62ACC9 for ; Sat, 18 Nov 2017 05:29:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C97F2ACD1; Sat, 18 Nov 2017 05:29:00 +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 ADAB92ACC9 for ; Sat, 18 Nov 2017 05:28:59 +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=SwLRaCUM0AmcBv7oTqflOAwI6mc+lMuJ1OKE4JfGt2c=; b=SBLTgZh2j1JF+5YFpfVBl4DF4R 85hiPkIlZnW0Gp3IyVn5DfcL3sNh6yBgvXjEFDFloTmSZ5mE9dJALixQnCVocFdHfCKtUf97gj46l 4BrM5WbX9/bmW3bTOCsCgqy7YUX59mPH264pMe55PoS0iKnwomhexbdDd7uqHFEXVPVJsy2Y6W98k 8tJMWbqOMqcXatsvGmk4S8LMdMCmy5kr8D2fRy+C7mYCghN7E+mv+gukmkljM6aIpnwQCgr1hmutf i7/feBPYO/rcnrxC7LJTLEvys2vFDiR0bnRwzw/j+D78NDx54XD0k04WWDxXuvsLEu0HV7S+GtE+q u3B5GXCQ==; 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 1eFvgQ-0004Cm-Va; Sat, 18 Nov 2017 05:28:51 +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 1eFvg7-0003w9-9G; Sat, 18 Nov 2017 05:28:33 +0000 Received: by mail-pg0-x244.google.com with SMTP id j16so3472363pgn.9; Fri, 17 Nov 2017 21:28:10 -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=BtRkELvfOnYoChNIuqUF54QmFJgtFbXGfCcUvi0KX10=; b=OELNza0rJEWWkX/ZjnvoPSoN9udnxGAhmjyrATO2FUoxtZKzLgd11fdnoIJi1hwtPi q0gyedbryflRHfb6CuA5khwPyu6Ki3w3j+EOB+4PP/R6bKGjFKXhOTvpcsEDResP/m+o bC44Cqf/1L+lxPLpCmQeCrX1VXES+Ij75kPAE2W39a0loIf02n0J7bef1MDM9iWb3fw+ srz4GTeRGFF/v5dfuKl54d3w8u4PekP68nWhVjMYJVsf2r1ixLzm9S59xDUoCdrY02wC fYnfHSD9ZV5yi/JLOovbPB5spbyyX1Tje2GiIGoDAaIzlr4sYuFCPSOpvvKG3MASGN+K pSwg== 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=BtRkELvfOnYoChNIuqUF54QmFJgtFbXGfCcUvi0KX10=; b=PZ6QN/jceCy29jRseSbvzP9SFmS8Kv8jDet+7w7Dm7dC0gh0V09SkNBFcv/irikM2N LyjnhSocPY9VdEQY08C66buqXaKtMZGz6WPpw8XETR4B4Ul01t3Sdk6iSo00Df6AsC0i qPxqCuvtA86s7Bf72obdHSYc2y231GqxSIKrT6e3FYMCEYZ4Ruh5GmKb0b0zAmlxIfno 3tb7yzrPjXd5SKuECvv2wuRa+xwWTUG0R1RIBG/H+0QFaAV7iQ9sqawzcBijZ6O9pvgz De8dsfGNc5WRb2ZZOckBAyFWRPSkw0BXEJiG8Fo8owt4uzGjlevQCAWmYl4oUfqJrjRo d3fg== X-Gm-Message-State: AJaThX7oDGwHA43Weiu7WPmW4ISYZS3Ot5UaqDJApOd0HUjUyi5P2ixg Vf5+DsZqMBHzGaBGHIXpz3o= X-Google-Smtp-Source: AGs4zMYeZuh8wbPtnmhP/lDDGi2RSubL/hVclyCADG+f5wdIvqjHUWtsUohEukx+zaAYAqWb5Gc1kA== X-Received: by 10.99.96.195 with SMTP id u186mr7025264pgb.298.1510982890171; Fri, 17 Nov 2017 21:28:10 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id d15sm10559781pfj.163.2017.11.17.21.28.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 21:28:09 -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 2/5 v2] ASoC: mt8173: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 10:57:52 +0530 Message-Id: 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_212831_426736_E8371B2D X-CRM114-Status: GOOD ( 10.35 ) 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 --- chnages in v2 : irq_id was unsigned. so changed it to signed. sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c index 8a643a3..11f5f2a 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -1083,7 +1083,7 @@ static int mt8173_afe_init_audio_clk(struct mtk_base_afe *afe) static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) { int ret, i; - unsigned int irq_id; + int irq_id; struct mtk_base_afe *afe; struct mt8173_afe_private *afe_priv; struct resource *res; @@ -1105,9 +1105,9 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) afe->dev = &pdev->dev; irq_id = platform_get_irq(pdev, 0); - if (!irq_id) { + if (irq_id < 0) { dev_err(afe->dev, "np %s no irq\n", afe->dev->of_node->name); - return -ENXIO; + return irq_id; } ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler, 0, "Afe_ISR_Handle", (void *)afe);