From patchwork Sat Nov 18 09:56:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064701 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 9C87560352 for ; Sat, 18 Nov 2017 10:03:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83E212A1A6 for ; Sat, 18 Nov 2017 10:03:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77D3B2A304; Sat, 18 Nov 2017 10:03:58 +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 0970D2A1A6 for ; Sat, 18 Nov 2017 10:03:58 +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=IrIKPjrUfchOEf0YuFT0CTkj+WpzbPIOR/GLrbHisW8=; b=FcJd9adu2SMV5n17W2JuaFJY79 VP83dMSu5yMIfP3V1C7Cz/mJe+mdJxNB9mN/3ZkQpsQMK1Qc7MD/cX+sYHURSvBEtZNEdHJCX+lNO 89fcDLjDf7fZCaxE23UFgIH3K64WF1mLccirQKWgYNLDd2VN5zxLQnpC1ng8up5z70iUsGO59EQDG Mf2HTeQh3ZUB+7BV9gKBGWu2o3xdTzOMUYZhriFgrgetXDcNV9JCLiDh9HEqSqAhSYZiH79gDNq0b i8QlNqmb+WIUiRGGG/4e6gcmya2BBSMmA+PYAMQKLzt6A1IBg1d8iRYhHMqPtt1QO+82QHaFkFTFc lycRAn/Q==; 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 1eFzyd-0005iG-2t; Sat, 18 Nov 2017 10:03:55 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eFzsJ-0002co-Ob; Sat, 18 Nov 2017 09:57:26 +0000 Received: by mail-pf0-x241.google.com with SMTP id 17so3741801pfn.12; Sat, 18 Nov 2017 01:57:03 -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=x3gQlaYucZMN329WaajmpaE3ug/AUg4opQB6usiJtkU=; b=St6eaLLmGf0fsFsivPJlVPO3TMmKwZUcEk10rqIruDqZ0SRFI6yhS4o85JS82EHhv6 BJH2YJePMRKAv5zpDx2afszgSj9NiqvYrULOnzcQlvXSCJ68INn5NrAPlZqfftGdczZv hwKIjvlO3cJ/FaO0a4B6iYOcZki1RBQg9sndcCnsLVnkckMpketHlP0QC0zY/s00WsKm 1Ve3HjWw3Rt1xwpuArt8HZ5Y8URd3UCjXHqYItd+0zZLkt2FWJTj/iv29Wx52PmE+HjR eA/SHzGRq8K2RsEr+zheg+JyEeK2TSYXGNpdLn5QNAz3avAqF3PdKnb2EaFC4BwBlSd4 eEjA== 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=x3gQlaYucZMN329WaajmpaE3ug/AUg4opQB6usiJtkU=; b=PJO+fQG+qRA1AVWCc9zCWyKgv13erkvxTSRMJMcqnqRRkfBjUNtxdYwwkLShX86mKu Hb6wnxsxsy7e3Ya9e0gk8+zFBMSzSJ6dS7I/+kD66UtarObN/lK8jSig2+HNv/Uf3pOD pZ4a74YOt9eKipa5zzfLoDt0zgvPIuwHcrZK8Fw0xWF3OhCBA0VWDdzbIu6EIll9l2OH SzQ7MXRvIrAwwmSKV1618QbhI3BX3FxeWSrkOU5qg8owND6pkT9K3BUXDDtVIYyqe0nK LjkkKV5woaB1BxbtpYYC5fDWuJIZ220L0SMWkzXvVs8DB6xqlaE4OO24buD2+1IuNVWi prPg== X-Gm-Message-State: AJaThX5l/pbSZ7pYUG8vMeFbf4jk9cz0wdecEMEIE0BKYz7GrCeP3QBT NZbyVWG8OCnKcOORwJM5rVc= X-Google-Smtp-Source: AGs4zMaEvVpslIR55UWqsQIMKt9NBibWb3o7mSf4xvx942pMzWp2Q+my05ltRd1BmfGG/lGFzKIKMg== X-Received: by 10.159.252.138 with SMTP id bb10mr7791878plb.163.1510999023010; Sat, 18 Nov 2017 01:57:03 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id r16sm8862577pgt.72.2017.11.18.01.56.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:57:02 -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 2/3 v3] ASoC: mt8173: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 15:26:46 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> References: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> In-Reply-To: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> References: <874375c0dca41790e47b60ce30f88ab353f97b38.1510997839.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_015724_043703_B1D526ED X-CRM114-Status: UNSURE ( 9.89 ) 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-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. 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);