Received: by 10.223.164.202 with SMTP id h10csp2366921wrb; Sat, 18 Nov 2017 20:24:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMajPjeX/mzZKfAWkNzLgqBedtSOSKpyoqhWz7ArEGvU4zyzAqv+xrkr7sGrPUUVmACsTOpG X-Received: by 10.98.253.3 with SMTP id p3mr7134077pfh.20.1511065450323; Sat, 18 Nov 2017 20:24:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511065450; cv=none; d=google.com; s=arc-20160816; b=pqn2EZ7vszy/WC7fwa4M4Tk8oaM5O3kYJrUtxjEQ5QclR6QZ5QkEqXSjMc+gxdFFNw kOhcE55MuZONeu4hFYI6i09SigvRsNfz0gdgvN8CRz1XU9qy75I+LYM/npstNGycz6aQ xcDtYVKPH4draijMgs7u3nFngfHaABKAZrbMXUq9k2gdN7bAVIOc05NK25MR/a+co7oZ 7skm+aBpblyqFpiKqobXKq2Ep4WA/SJEaqcyIzNOqavJjnuc7/ov85X5vvqMthHHQjc6 ip/WXXE3eRBnkGjEPWWnrEWrp4AxOz+k14Sf79kuwRHYFFMLWk7Wcq+YGStkG7yFVLlD qyBA== 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=P+sxC+or19mYfeucLu3FYkOEj99t089kWnhdgh5EB58=; b=LbG5gMIwhuSpuQkuu/8k7Qu2z275r7ptyaS2Pw5XQQyP4yP4/+oC0D+6msq06ds7cL gZ190C466pop20ERA+KvdPpeL7zjXiUtKuPz04oewseAUXYn+nzb1GZ2huV3dwrVZPrW xd4MjxcwzDuc/yBFiqxkYjxQrV791doARrEZCZPFPKOP68kvFxquSYlS9BlqMe+TfDZF fGjJEYZlprOml61gTJr8sjoLA+PwZ0fnI4UNGGZyAhsxibQ4QtDt7Mhll7UwDzLo6nnA 3dG4xT7THAf8MGmiREZMopnFWIapGWsGm9h4n6AXMvdd3KPTR9721dAzZNPfFsX+t14+ KAyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KMTfpOaW; 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 v68si5441937pgv.557.2017.11.18.20.23.59; Sat, 18 Nov 2017 20:24:10 -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=KMTfpOaW; 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 S1751410AbdKSEQP (ORCPT + 75 others); Sat, 18 Nov 2017 23:16:15 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:41489 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbdKSEPa (ORCPT ); Sat, 18 Nov 2017 23:15:30 -0500 Received: by mail-pg0-f66.google.com with SMTP id p9so4839916pgc.8 for ; Sat, 18 Nov 2017 20:15:30 -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=P+sxC+or19mYfeucLu3FYkOEj99t089kWnhdgh5EB58=; b=KMTfpOaWI12yX4+UEGYv6vNHk4Q+YBbuTrkirILibMbH2PGtKrg5goLe+VVbXjjS4O wRDlWrLsQkP+o1tfQacdg7wZL9wUWPDuGEtn8ob3lwcNVUGkhC6fldNNgN8qhMISUK0f pwsDEA+HljIYhkq5NuQxTSBvFAajRz/UlWx7pp7w/0RDl8VeZcphMiDK5loOyKHV8u5s Ll4zDHbxh29aMj15CknObv7BLmOhEMTQpEdycjrw0Y9Oq+cWE8l8BlDbJ9eWNAvRtrGM 60r2ChhwnsZSQVoehGtSSgCcvlz0I+rk0rwu6Dv0T6RVYU6TpupY8tSCsy9B+eZI9cP/ EvPQ== 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=P+sxC+or19mYfeucLu3FYkOEj99t089kWnhdgh5EB58=; b=FgbyyWJ34mmaoXTKWMX6RNdChwHkn86mskWaz9xcaXm3ww1Xl1QRrV1Ybx6fSmyhH7 Xg9gelTQYFJNLbdeCn8MSFL65nOQVwwG+hCVaYHEkM9SK9wk0mw/leqsotQmzYc5a/jy XeemthkKpfifYEJfkqy+ArdhYj9cBSMTGrYwFT3dZdR8VI+ZTaJW8N0Pnp23YSLZph7d odfoqwRxQBUNblSJoIJVuAJB2ZYukk5/+rlqBVA6vff28CUjOQ0nNLYcEDOJgISU46xu TFkGVFpcnKXH+XhjWcGfpKwuGELp2hNauSEwGN9WCztU3tN6jblzWwAb36l7KSX9UgFo R+Og== X-Gm-Message-State: AJaThX5iYT6S17HPW3XnSJoGhGXsDi9bmGCMLIkhTOGO3IbV8aHGN/Xh VKWQYRPjzrhMqtzLFE6J6DM= X-Received: by 10.159.229.136 with SMTP id az8mr9974180plb.59.1511064930065; Sat, 18 Nov 2017 20:15:30 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id l14sm12741475pgn.35.2017.11.18.20.15.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 20:15:29 -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 3/5 v4] ASoC: nuc900: Fix platform_get_irq's error checking Date: Sun, 19 Nov 2017 09:45:02 +0530 Message-Id: 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 using signed variable ret. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. changes in v4 : Return -ENODEV insted of irq. sound/soc/nuc900/nuc900-ac97.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index b6615af..893ccf2 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -345,11 +345,12 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev) goto out; } - nuc900_audio->irq_num = platform_get_irq(pdev, 0); - if (!nuc900_audio->irq_num) { + ret = platform_get_irq(pdev, 0); + if (ret <= 0) { ret = -EBUSY; goto out; } + nuc900_audio->irq_num = ret; nuc900_ac97_data = nuc900_audio; -- 2.7.4 From 1584505409283417010@xxx Sun Nov 19 14:35:13 +0000 2017 X-GM-THRID: 1584505409283417010 X-Gmail-Labels: Inbox,Category Promotions,HistoricalUnread