Received: by 10.223.164.202 with SMTP id h10csp2366780wrb; Sat, 18 Nov 2017 20:23:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMamke9uWGmua2eHBHoSaZCHWZfFNY13DAnpb6/bT4NIKBen0ZAm8bIuylex5Xyu1TGKyLrm X-Received: by 10.99.137.194 with SMTP id v185mr9594558pgd.160.1511065436967; Sat, 18 Nov 2017 20:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511065436; cv=none; d=google.com; s=arc-20160816; b=psdMtG+5VPDvG3NBVa/XnKZhL587bq/qBl1rUnF5Ifa7s+X5XEAuM52OJQWLnlrLdt we4bEdTv5ZABeIqNhs1DDBHGas+CXQSSi7XTtSg/RAlC57RAEDyQ+UpVlJrqomK1Kbp+ SBNSmnvjxZDUvoRebxtKmhvDz0MWkcW+2Qa2U86dmV65pJGbfmDujZrT9/e4YU3giU03 b96ulyHkUkl/1lW7CP16W+VsRhk7io4OXHGqphF+9Fgz+AFAIMg44wKe5IGTebuzNLGE /Bz2VcYUbIKD1EVaaiG5gwEqm/Zdp2h4YyM04hoYLWbz2j3yKPmBqF3whibpMrqvPkoi DEjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=B1HhHZkdiC0W1ZMgeP2ZlbKVfQm15hsnC9elkWUva0o=; b=wbOVkIhzgndwj18miGaeigrIMztS2BpRDMJsvc2X32lHNoueBb1sxG/iLUr9/3LnJz H3kl7nwfaVmUvHHgB4IuiodkKLIfA0/rvcR3jFVFbQ6xwF60SQ3xrWp80OXfJBxcL8X6 O6h2K+t9PZ+6Gmne+UIr3MoyK9SLycvGBHZ5M4tIxGO8FjIkhJP7XwjEhZggmKXVMr7p P6adX15LVbTgCfamHVcFwCxq2C7NSJAvGloH9XI3/Lo9rAJwsYSQsM2cJeGYnu7eWmvQ 2V5Is/SClrIiWR6wP1S/HuGuImqT29SCTizhPETZGhhHm3/6SIGI+/XTK4iz0V6bw1cp 26xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WY6HfkKU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k7si5783326pls.500.2017.11.18.20.23.46; Sat, 18 Nov 2017 20:23:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WY6HfkKU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330AbdKSEPc (ORCPT + 75 others); Sat, 18 Nov 2017 23:15:32 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34663 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbdKSEP0 (ORCPT ); Sat, 18 Nov 2017 23:15:26 -0500 Received: by mail-pf0-f195.google.com with SMTP id x7so4850372pfa.1 for ; Sat, 18 Nov 2017 20:15:26 -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=Qv8dbQX9BbIcfi0UC9+4lMEa0l/YwZhFXjCKlr5IOZt9s/jOZmUJTXpAQS7Bs4anib 6UC3bS0Ni1lzw0XyjOrkRfpKg7+lU7YQH02zRNKnvpJAJ+/yiMOJ6HDxazgb1APcBPJq 6adNytFNEuDjM3/kEmhW8PTEEPXr32ikSV7BK+ajScYDjWQg3v7/x82VnbvDfSTcHEFX GCwxqj0GLLrowwrwJxiaQ6veZ1yXVs5zf/Ll2/5zMoE37H190zQHAIwDEaBxtastkLHh ODbJ3zF8893okkqm6wA5yZoiVgz3xwWzohxBp/yGz+y491Mjw2SzTyRBQwYd3cFEXLub fluQ== X-Gm-Message-State: AJaThX7jgdeapQ7xcRc6NVoclrhdKHS2Q6tgTR9338tgGwmtri+8qdEP k2U+5qZNpNvafmcwk9YbEwU= 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 Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4 From 1585984346118863806@xxx Tue Dec 05 22:22:17 +0000 2017 X-GM-THRID: 1585984346118863806 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread