Received: by 10.223.164.202 with SMTP id h10csp4566297wrb; Wed, 29 Nov 2017 08:18:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMb1tN6wLo4wxISAaA4uumvoBD2VIUy3rmt7J3RzZPNcd9S3dLzWo4GiVdsOLNnVfaXtjyVI X-Received: by 10.84.235.140 with SMTP id p12mr3344082plk.153.1511972332935; Wed, 29 Nov 2017 08:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511972332; cv=none; d=google.com; s=arc-20160816; b=Sm6HzxuZqR/muCkhfIFH+WP8E626yAAAm86iXmKpweCikU7cUr3hw574SnQQU1dUVq NP4zgf+ft6M9TX3P1MBG9dm+9YJCY0/ZMByrJ/GyRqWb5JkDQLm6eU8xcKVpLe4NlZ4Q px/ppWXp3rew1fLkSfz3R5TuusRwXP+FpeTQ3JKhlMcVnl9vQKHMtyMdpqVB/KM2xQ0Q o08oebMA1ritxaTcIVteeS/c1PcO/3MkskPz5wWf7Y5PkqkbF3nDqnwZXupHj8ql0996 ixFGcABgoN7Izt30bcPR1rR78VZZuWWzZk4izEXyf0P0EzZAF/GCFyfq9k8vqABb8IuS 2VTw== 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=XJu+0xtEbJ5OwNG616loRCspE/NSZfdw64xVYGTfhqk=; b=kT0tsZB4n0Xe7qp6i1hqjdQ81jywi6ZAVR13lVe1Rx8DBiHaidu9mxiyuV6l0Xj3I4 rwenITYNZYd3ov/Vf867AjXv3IegA6voMI+lDIS6k1Rr/WcE/GBNYWnElf0TzdKVxx24 XIJLRODL1RFXAAW8WfzbTuZDT5sJ/w6f+Bz2BwZyTbJI9p2KBW5d44xjjnpZOaIR4mg8 HR9q7E6IAJ3xI+iDaPgBIP7yHAp4RkXJP18/1hWSp0FCR4pRlYeaedoO+cpNlXxaGjZl IzBKi0jdlBN69TBoArqII6QaEC8FE3bThjwm0hGXGhMum/eorbnGJL/RModSazZoMirk /3bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xdcl+FM3; 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 b29si1503482pge.24.2017.11.29.08.18.39; Wed, 29 Nov 2017 08:18:52 -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=Xdcl+FM3; 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 S933035AbdK2QRv (ORCPT + 69 others); Wed, 29 Nov 2017 11:17:51 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:34817 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbdK2QRs (ORCPT ); Wed, 29 Nov 2017 11:17:48 -0500 Received: by mail-pl0-f66.google.com with SMTP id b96so2379713pli.2 for ; Wed, 29 Nov 2017 08:17:48 -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=XJu+0xtEbJ5OwNG616loRCspE/NSZfdw64xVYGTfhqk=; b=Xdcl+FM3j30zZekEZ/1WXXADZ1tRXaMjKLHaKr/tRSyxMDtfLs98iILWJb+KipR2er xWTyE+MEFmg+EXlTGJ3NzsK4966ZfBBKiFl+4lya18hCug/O+PVPW3t5H+D68cdaiS2o SJbRIr2xJgpcoc5rCk8w1rqcykOSsybW/GrpSM9BN2skRxmzq4r4GuR8uUDIyKejoTr0 Vm63Ou0rULXd3IvkJ1Ti42h0YjyhyY2VvPzPMfPmCqTGykXwm76k+KCE/zTfl7u6b1p8 oi5pvozKPkTS78MMfB37cFRkh+mNAHemzc7P/KyPATiNsJ1CsAOGUOA1oSRG7U15v0YG HwVw== 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=XJu+0xtEbJ5OwNG616loRCspE/NSZfdw64xVYGTfhqk=; b=lxH1eI8fTl8JG27aqO+oWZ0n6qaUMmMOqfBJ8px1s6vLGY9V/K3L87gwv4f0Am8ZZW 8oUh1s5w88ur7Lc9tWuhADZORGKH67DLMMRCTnby7d5z/BFIAvXT3xHcglRXenSkzg1A r0yhQu3FB3QdMN264r7WWUVm2k81//A0XC7p0EovHE5eA9O2AepEryxDObsxZRF2DEOB 1bei3FzRTWx2tvMBrjbcPXxfsN7C3QIVEUNjX0xSt8Ax15gRFF9bCH9BND+hIG7AzwOd O5gte+Zxn9QSxd5BR7UVxXTQrvJZ6n4jUX5X4HfdF3C5mngy4loS/tMDV/VXBeBIckTC BnZw== X-Gm-Message-State: AJaThX4NG9Qy8DRdZQ6PNUpHxioFZ9RINxZBruTJbDKwos5YsQUP9IcD YSXWX1SocKnQO45WEbM9vso= X-Received: by 10.84.244.11 with SMTP id g11mr3431472pll.80.1511972267663; Wed, 29 Nov 2017 08:17:47 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id q74sm3867400pfd.134.2017.11.29.08.17.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 08:17:46 -0800 (PST) From: Arvind Yadav To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, matthias.bgg@gmail.com 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/5 v5] ASoC: mt8173: Fix platform_get_irq's error checking Date: Wed, 29 Nov 2017 21:47:11 +0530 Message-Id: <79e17e6083f5142c4707c94519577b6682a76566.1511970158.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> In-Reply-To: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.git.arvind.yadav.cs@gmail.com> References: <4ce907b8389af30eb0677e70cf543a2b795cca12.1511970158.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 -ENXIO insted of irq. changes in v5 : Add separate error for irq == 0 and irq < 0. 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..c7f7f8a 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 < 0 ? irq_id : -ENXIO; } ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler, 0, "Afe_ISR_Handle", (void *)afe); -- 2.7.4 From 1585313318044684498@xxx Tue Nov 28 12:36:34 +0000 2017 X-GM-THRID: 1585306100041162022 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread