Received: by 10.223.164.202 with SMTP id h10csp2350171wrb; Sat, 18 Nov 2017 19:57:12 -0800 (PST) X-Google-Smtp-Source: AGs4zMaZe+UhLfVjzKUNAWN7FMjUFjsUaf5AZg9JORtmyslQGWp8kJOA6uzeoao1z6Qtk2c9ViSJ X-Received: by 10.98.35.92 with SMTP id j89mr6920436pfj.49.1511063832370; Sat, 18 Nov 2017 19:57:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511063832; cv=none; d=google.com; s=arc-20160816; b=fQdDUfqA56MCdzpnjtXoUe2/F86ApjvaViPcR9ANDSfjHmjFa/ZZ9FzuTWnavXeOK0 I2fYvqK0jdH5MklArhbNV+11Z4H1GfUt0HSjVj/9PnOYLc6Ir29itdqeRu9L2KQhCMYo jDtWiPrRoGCLhsCWXMZhOEbLKufxstargAEcKZuaGHkSEgQhIkrpL31ryMTQOUCAPjrs LdTykFScbQzHvcDp2KzPgF4qz9ZRLFf/yZ5/gvki3BN0OJCZRfHvjaW/owHv0QaPqv/J WrUiTNdC5+91TIR3wFok3jDqg0NL6QaHcOqVDo43asVIpAsmIzcR/atAvo1sf8N7aVOB 4qKw== 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=x3gQlaYucZMN329WaajmpaE3ug/AUg4opQB6usiJtkU=; b=jRs2eLx8dffnF5Jvox9BQzfApb2EABDWgbzPIJKc2tQ2aY8bFf3m/5evM35oRkBkgl hQhvcRKEWk4819uNhvy2VWa2QvqhVGaKFS6nXKH9OMKqr33CQ6GlA42U0+P5mtRb+GPe sXYATBIeFOHA/kAAZQWo4G4tDJZl2vQL8dvYaB0D35eA088gxkZbaat4HeciFfHHEfjU xLilW8JNPvH/0sS2CkSD4cJUFPGiNbDeG0MozCa5SDj0E1RRp5f8LmkldBw4aS4Omb/K u9vOorX5gyiqAoQ6M7QAtAWdlT0H5OdYaYg8aL3MEDWGTAH25OdOtrXXWBpZm1KUrtmf fNLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=St6eaLLm; 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 k126si5999780pfc.348.2017.11.18.19.56.59; Sat, 18 Nov 2017 19:57:12 -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=St6eaLLm; 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 S1163433AbdKRJ5R (ORCPT + 93 others); Sat, 18 Nov 2017 04:57:17 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46343 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163169AbdKRJ5D (ORCPT ); Sat, 18 Nov 2017 04:57:03 -0500 Received: by mail-pf0-f193.google.com with SMTP id q4so3745052pfg.13 for ; 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=bELkCrwdYU1SWVlI9LKzvk0fM4Qs2YCTN395C6bFcoEJGvIXKvBUMKvhBnzMY29d/C eLE/kwAnrgT2IEwJ545hc2sU1HIQj4rzbCS9QsDbuuQa6JG8c/CrG93Di2ZWP3g3Tf94 lBU5QFYrdCyEIxoCrb5kWL6CYukWyU7BJRWmeKNQSSy9Qm43mOmSGQEkG0weOAFTACHQ KWeIgbG2mcAEktGFLVIMMCE90mTBiU+0G+icyLbpqRaEbJeiYvfJcvYkSBnAgKQs72ZU Ek1Rjvh64qD8+XmHb6dpW5AsU3t0sQlKDQZg8Y5fB49G9CvJ7z/4dncgp4S5MEF0sTtN eHJw== X-Gm-Message-State: AJaThX43VFOR4MKpwReNPGOkJ8LMwy8VceUdqDPMA7rP7bnM+h2SjTl2 VoAido1B9APJPNHVq/ZbnLs= 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 Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org 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> 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. 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); -- 2.7.4 From 1584467197124057888@xxx Sun Nov 19 04:27:51 +0000 2017 X-GM-THRID: 1584467197124057888 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread