From patchwork Sun Nov 19 04:15:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10065009 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 E051A602CB for ; Sun, 19 Nov 2017 04:16:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD2832952A for ; Sun, 19 Nov 2017 04:16:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C200A29530; Sun, 19 Nov 2017 04:16:59 +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 5566C2952A for ; Sun, 19 Nov 2017 04:16: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=hE1hiKhWW8QrAxwfopxMLThvgM19MP9WW7nQfj7qDYw=; b=c7xlAWNTu6+Rj24lnLukjHKs9Z PYOCQYeL1NZUDf3K+rfb41AcJWRqLLfFxfT78VfHuLY09Y6ZjrbpB7zXeOD5vsh8L15xFc9FiK06V xlNeKlGRE3ryqiBZxa2QGOUUcJ8+QKiR+yYJVSMyTlTpkRgJZ11FQDMPT/Af1TYwY35s2eOmXPL2I pIY4EHG1//NKKFkglFnS5le6ITD/aiKkw46Pjhr07C+UPtCjgMO/UA0mOY8BxUxpabelg7HyqWW6s em/AITHILmQiESC+cSFEEH+XhVztbeqHJHU53rRrJP3Y9TAVjl87/zLDr8zxWpnfUdTd8/Ae8o8ZG y7MKYqXg==; 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 1eGH2Q-0000dH-2O; Sun, 19 Nov 2017 04:16:58 +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 1eGH1H-0007BA-Lx; Sun, 19 Nov 2017 04:15:49 +0000 Received: by mail-pf0-x241.google.com with SMTP id q4so4822890pfg.13; Sat, 18 Nov 2017 20:15:27 -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=B1HhHZkdiC0W1ZMgeP2ZlbKVfQm15hsnC9elkWUva0o=; b=WY6HfkKUev6iz+xl439SVY+rpibFg3YY+s8E1T0im3lYyXtbN0u9dOBnHiUopkql+B yHkF7h7V+ACvoxdT26MRWfxL0zl+cNld28Qf7R622F/VCr8qmAKik1mXw+BD71YivfSH wosF3XN4ZJM5x2D/tFMgjLo1T3AsDS39Ql+C3BBfcEYbnffjqo9wNAAhyBF4viHaCfLf nSeL2UxnzzgLgtPaf7BK5GMwkzJ3jvfsaWtcj5q2GJJlHrOr6gwdykFF84XFajGiEPt9 bmrBMVL/bOPW27nAAP2tYWBjE3Ez7F/u3kemEQqhrkd34fdLu2AB7Lqfy0zbhsk/V9NZ v2MQ== 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=B1HhHZkdiC0W1ZMgeP2ZlbKVfQm15hsnC9elkWUva0o=; b=fbleKlvG2ZzhVKBeJtWdvD8Y1iElTZzl8a/ZQE1YuZwD0vmkv437CrJPSHG9ldKmEO p76dTxPW9Ck8Vf7NBhxno1ht17mcmnGm5/ETzsAzjw2JyA2UVeb66GV6XIqwiwVTMg61 dC5mz+qDmrHyfxGAKpl0yf8DJxiultmiAaMX1GCr59oNuAW1LFmLNMJXvQSguZaeZg+H UamM9R+zrAYvIw8Q42tYOoMQIgLJXoWULI3Mokq2S+VWhKscpJkdhzkG1Vjo/IxiQjqa 5+vdXJ7obCFhrUbzQdToBfvO7Q3FqKBQBBduDcj11jFTS2YGcUZ2lR0uSNBY/pDRKeNF SWHw== X-Gm-Message-State: AJaThX5GfY1RXWqjU3RFaH6cE3LLQBHMdDf/Uv/tvFl6koNiDtCZjp/p UCSHXpCIcz9Ha7BLmhXu4Ho= X-Google-Smtp-Source: AGs4zMZI1yd9Bv4lmrKpSKkJBKwbO0PjeBBYIdJENtrjbwwY/S0Xj3TuRaMQAaO93HZ65ZVYl6l3bQ== X-Received: by 10.101.65.129 with SMTP id a1mr9663062pgq.203.1511064926434; Sat, 18 Nov 2017 20:15:26 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id l14sm12741475pgn.35.2017.11.18.20.15.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:15:25 -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, linux@armlinux.org.uk Subject: [PATCH 2/5 v4] ASoC: mt8173: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 09:45:01 +0530 Message-Id: <3486c0c54d071b1d5cab0c070f2cc7ab63ef0806.1511062844.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> References: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> In-Reply-To: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> References: <082d4479211d425219f4ab275ecc12e1011eca2f.1511062844.git.arvind.yadav.cs@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_201547_749837_B671EEED X-CRM114-Status: GOOD ( 11.38 ) 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-kernel@vger.kernel.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. changes in v4 : Return -ENODEV insted of irq_id. sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c index 8a643a3..1153566 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,7 +1105,7 @@ 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; }